JNSimba commented 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' = '11.221.147.11: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' = '11.221.147.11: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:
us...@infra.apache.org



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

Reply via email to