简单例子

    1. CREATE TABLE source_table (
    2. f0 INT,
    3. f1 INT,
    4. f2 STRING
    5. ) WITH (
    6. 'connector' = 'jdbc',
    7. 'url' = 'jdbc:mysql://192.168.2.101:3306/flink_test',
    8. 'table-name' = 'source_table',
    9. 'username' = 'root',
    10. 'password' = 'root',
    11. 'lookup.cache.max-rows' = '100',
    12. 'lookup.cache.ttl' = '10s',
    13. 'lookup.max-retries' = '3',
    14. 'rows-per-second'='5'
    15. );
    16. CREATE TABLE print_table (
    17. f0 INT,
    18. f1 INT,
    19. f2 STRING
    20. ) WITH (
    21. 'connector.type' = 'jdbc',
    22. 'connector.url' = 'jdbc:mysql://192.168.2.101:3306/flink_test',
    23. 'connector.table' = 'print_table',
    24. 'connector.username' = 'root',
    25. 'connector.password' = 'root',
    26. 'connector.write.flush.max-rows' = '1'
    27. );
    28. insert into print_table select f0,f1,f2 from source_table;