final TestTableDescriptor testDesc = new TestTableDescriptor( new Kafka() .version(getKafkaVersion()) .sinkPartitionerFixed() .withFormat(new TestTableFormat()) .withSchema( new Schema() .field(FRUIT_NAME, Types.STRING()) .field(COUNT, Types.DECIMAL()) .field(EVENT_TIME, Types.SQL_TIMESTAMP())) .inAppendMode(); final Map<String, String> propertiesMap = testDesc.toProperties(); final TableSink<?> actualSink = TableFactoryService.find(StreamTableSinkFactory.class, propertiesMap) .createStreamTableSink(propertiesMap);
final TestTableDescriptor testDesc = new TestTableDescriptor( new Elasticsearch() .version(getElasticsearchVersion()) .connectionMaxRetryTimeout(100) .connectionPathPrefix("/myapp")) .withFormat( new Json() .deriveSchema()) .withSchema( new Schema() .field(FIELD_KEY, Types.LONG()) .field(FIELD_COUNT, Types.DECIMAL()) .field(FIELD_TS, Types.SQL_TIMESTAMP())) .inUpsertMode(); final Map<String, String> propertiesMap = testDesc.toProperties(); final TableSink<?> actualSink = TableFactoryService.find(StreamTableSinkFactory.class, propertiesMap) .createStreamTableSink(propertiesMap);
final TestTableDescriptor testDesc = new TestTableDescriptor( new Kafka() .version(getKafkaVersion()) .withFormat(new TestTableFormat()) .withSchema( new Schema() .field(FRUIT_NAME, Types.STRING()).from(NAME) new Rowtime().timestampsFromField(TIME).watermarksPeriodicAscending()) .field(PROC_TIME, Types.SQL_TIMESTAMP()).proctime()) .inAppendMode(); final Map<String, String> propertiesMap = testDesc.toProperties(); final TableSource<?> actualSource = TableFactoryService.find(StreamTableSourceFactory.class, propertiesMap) .createStreamTableSource(propertiesMap);