use of org.apache.flink.table.api.TableDescriptor in project flink by apache.
the class PushProjectIntoTableSourceScanRuleTest method testMetadataProjectionWithoutProjectionPushDownWhenNotSupported.
@Test
public void testMetadataProjectionWithoutProjectionPushDownWhenNotSupported() {
final SharedReference<List<String>> appliedKeys = sharedObjects.add(new ArrayList<>());
final TableDescriptor sourceDescriptor = TableFactoryHarness.newBuilder().schema(NoPushDownSource.SCHEMA).source(new NoPushDownSource(false, appliedKeys)).build();
util().tableEnv().createTable("T2", sourceDescriptor);
util().verifyRelPlan("SELECT m1, metadata FROM T2");
assertThat(appliedKeys.get(), contains("m1", "m2", "m3"));
}
use of org.apache.flink.table.api.TableDescriptor in project flink by apache.
the class PushProjectIntoTableSourceScanRuleTest method testMetadataProjectionWithoutProjectionPushDownWhenNotSupportedAndNoneSelected.
@Test
public void testMetadataProjectionWithoutProjectionPushDownWhenNotSupportedAndNoneSelected() {
final SharedReference<List<String>> appliedKeys = sharedObjects.add(new ArrayList<>());
final TableDescriptor sourceDescriptor = TableFactoryHarness.newBuilder().schema(NoPushDownSource.SCHEMA).source(new NoPushDownSource(false, appliedKeys)).build();
util().tableEnv().createTable("T4", sourceDescriptor);
util().verifyRelPlan("SELECT 1 FROM T4");
assertThat(appliedKeys.get(), contains("m1", "m2", "m3"));
}
use of org.apache.flink.table.api.TableDescriptor in project flink by apache.
the class PushProjectIntoTableSourceScanRuleTest method testMetadataProjectionWithoutProjectionPushDownWhenSupportedAndNoneSelected.
@Test
public void testMetadataProjectionWithoutProjectionPushDownWhenSupportedAndNoneSelected() {
final SharedReference<List<String>> appliedKeys = sharedObjects.add(new ArrayList<>());
final TableDescriptor sourceDescriptor = TableFactoryHarness.newBuilder().schema(NoPushDownSource.SCHEMA).source(new NoPushDownSource(true, appliedKeys)).build();
util().tableEnv().createTable("T3", sourceDescriptor);
util().verifyRelPlan("SELECT 1 FROM T3");
assertThat(appliedKeys.get(), hasSize(0));
}
use of org.apache.flink.table.api.TableDescriptor in project flink by apache.
the class RemoveUnreachableCoalesceArgumentsRuleTest method before.
@Before
public void before() {
util = streamTestUtil(TableConfig.getDefault());
final TableDescriptor sourceDescriptor = TableFactoryHarness.newBuilder().schema(Schema.newBuilder().column("f0", STRING().nullable()).column("f1", STRING().notNull()).column("f2", STRING().nullable()).build()).unboundedScanSource().build();
util.tableEnv().createTable("T", sourceDescriptor);
}
use of org.apache.flink.table.api.TableDescriptor in project flink by apache.
the class WrapJsonAggFunctionArgumentsRuleTest method testJsonObjectAggInGroupWindow.
@Test
public void testJsonObjectAggInGroupWindow() {
final TableDescriptor sourceDescriptor = TableFactoryHarness.newBuilder().schema(Schema.newBuilder().column("f0", INT()).column("f1", STRING()).build()).unboundedScanSource().build();
util.tableEnv().createTable("T", sourceDescriptor);
util.verifyRelPlan("SELECT f0, JSON_OBJECTAGG(f1 VALUE f0) FROM T GROUP BY f0");
}
Aggregations