XComp edited a comment on pull request #17152:
URL: https://github.com/apache/flink/pull/17152#issuecomment-913540205


   FLINK-23850 job:
   ```
           Configuration config = new Configuration();
           
config.set(ExecutionCheckpointingOptions.ENABLE_CHECKPOINTS_AFTER_TASKS_FINISH, 
true);
   
           StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment(config);
           env.setRuntimeMode(RuntimeExecutionMode.STREAMING);
           env.setRestartStrategy(RestartStrategies.fixedDelayRestart(20, 
2000));
           env.enableCheckpointing(10000, CheckpointingMode.EXACTLY_ONCE);
           env.getCheckpointConfig().setMaxConcurrentCheckpoints(2);
           env.setParallelism(6);
   
           final StreamTableEnvironment tableEnv = 
StreamTableEnvironment.create(env);
   
           tableEnv.createTable("T1",
                   TableDescriptor.forConnector("kafka")
                           .schema(Schema.newBuilder()
                                   .column("pk", DataTypes.STRING().notNull())
                                   .column("x", DataTypes.STRING().notNull())
                                   .build())
                           .option("topic", "flink-23850-in1")
                           .option("properties.bootstrap.servers", 
FLINK23850Utils.BOOTSTRAP_SERVERS)
                           .option("value.format", "csv")
                           .option("scan.startup.mode", "earliest-offset")
                           .build());
   
           final Table resultTable =
                   tableEnv.sqlQuery(
                           "SELECT "
                                   + "T1.pk, "
                                   + "'asd', "
                                   + "'foo', "
                                   + "'bar' "
                                   + "FROM T1");
   
           tableEnv.createTable("T4",
                   TableDescriptor.forConnector("kafka")
                           .schema(Schema.newBuilder()
                                   .column("pk", DataTypes.STRING().notNull())
                                   .column("some_calculated_value", 
DataTypes.STRING())
                                   .column("pk1", DataTypes.STRING())
                                   .column("pk2", DataTypes.STRING())
                                   .build())
                           .option("topic", "flink-23850-out")
                           .option("properties.bootstrap.servers", 
FLINK23850Utils.BOOTSTRAP_SERVERS)
                           .option("value.format", "csv")
                           .option("sink.delivery-guarantee", "exactly-once")
                           .option("sink.transactional-id-prefix", 
"flink-23850")
                           .option("scan.startup.mode", "earliest-offset")
                           .build());
   
           resultTable.executeInsert("T4");
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to