use of org.apache.flink.connector.jdbc.internal.options.JdbcReadOptions in project flink by apache.
the class JdbcDynamicTableFactoryTest method testJdbcReadProperties.
@Test
public void testJdbcReadProperties() {
Map<String, String> properties = getAllOptions();
properties.put("scan.partition.column", "aaa");
properties.put("scan.partition.lower-bound", "-10");
properties.put("scan.partition.upper-bound", "100");
properties.put("scan.partition.num", "10");
properties.put("scan.fetch-size", "20");
properties.put("scan.auto-commit", "false");
DynamicTableSource actual = createTableSource(SCHEMA, properties);
JdbcConnectorOptions options = JdbcConnectorOptions.builder().setDBUrl("jdbc:derby:memory:mydb").setTableName("mytable").build();
JdbcReadOptions readOptions = JdbcReadOptions.builder().setPartitionColumnName("aaa").setPartitionLowerBound(-10).setPartitionUpperBound(100).setNumPartitions(10).setFetchSize(20).setAutoCommit(false).build();
JdbcLookupOptions lookupOptions = JdbcLookupOptions.builder().setCacheMaxSize(-1).setCacheExpireMs(10_000).setMaxRetryTimes(3).build();
JdbcDynamicTableSource expected = new JdbcDynamicTableSource(options, readOptions, lookupOptions, SCHEMA.toPhysicalRowDataType());
assertEquals(expected, actual);
}
Aggregations