wuchong commented on a change in pull request #11047: [FLINK-15912][table] Add
Context to TableSourceFactory and TableSinkFactory
URL: https://github.com/apache/flink/pull/11047#discussion_r379996777
##########
File path:
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveTableFactoryTest.java
##########
@@ -78,9 +83,39 @@ public void testGenericTable() throws Exception {
Optional<TableFactory> opt = catalog.getTableFactory();
assertTrue(opt.isPresent());
HiveTableFactory tableFactory = (HiveTableFactory) opt.get();
- TableSource tableSource = tableFactory.createTableSource(path,
table);
+ TableSource tableSource = tableFactory.createTableSource(new
TableSourceFactory.Context() {
+ @Override
+ public ObjectIdentifier getObjectIdentifier() {
+ return ObjectIdentifier.of("mycatalog", "mydb",
"mytable");
+ }
+
+ @Override
+ public CatalogTable getTable() {
+ return table;
+ }
+
+ @Override
+ public ReadableConfig getConfiguration() {
+ return new Configuration();
+ }
+ });
assertTrue(tableSource instanceof StreamTableSource);
- TableSink tableSink = tableFactory.createTableSink(path, table);
+ TableSink tableSink = tableFactory.createTableSink(new
TableSinkFactory.Context() {
Review comment:
Can we introduce a `TableSinkFactoryContextImpl` class to reduce so many
anonymous classes?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services