You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/03/24 11:29:27 UTC

[GitHub] [incubator-doris] JNSimba edited a comment on pull request #5375: [Feature] Add flink datastream connector example (#5371)

JNSimba edited a comment on pull request #5375:
URL: https://github.com/apache/incubator-doris/pull/5375#issuecomment-802749846


   Refer to [User-defined Sources & Sinks](https://ci.apache.org/projects/flink/flink-docs-stable/zh/dev/table/sourceSinks.html) And flink-connector-jdbc, add flink sql to create doris table, and write doris table through streamload。
   
   eg:
   ```java
            EnvironmentSettings settings = EnvironmentSettings.newInstance()
                   .useBlinkPlanner()
                   .inStreamingMode()
                   .build();
           TableEnvironment tEnv = TableEnvironment.create(settings);
           tEnv.getConfig().getConfiguration().setString("job.name","test");
   
           tEnv.executeSql(
                   "CREATE TABLE doris_test (" +
                           "name STRING," +
                           "age INT," +
                           "price DECIMAL(5,2)," +
                           "sale DOUBLE" +
                           ") " +
                           "WITH (\n" +
                           "  'connector' = 'doris',\n" +
                           "  'fenodes' = 'FE_IP:8030',\n" +
                           "  'table.identifier' = 'demo.doris_test_source_2',\n" +
                           "  'username' = 'root',\n" +
                           "  'password' = ''" +
                           ")");
           tEnv.executeSql(
                   "CREATE TABLE doris_test_sink (" +
                           "name STRING," +
                           "age INT," +
                           "price DECIMAL(5,2)," +
                           "sale DOUBLE" +
                           ") " +
                           "WITH (\n" +
                           "  'connector' = 'doris',\n" +
                           "  'fenodes' = 'FE_IP:8030',\n" +
                           "  'table.identifier' = 'demo.doris_test_sink_2',\n" +
                           "  'username' = 'root',\n" +
                           "  'password' = ''\n" +
                           ")");
   
           tEnv.executeSql("INSERT INTO doris_test_sink select name,age,price,sale from doris_test");
   ```
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org