Search in sources :

Example 1 with CalciteConfig

use of org.apache.flink.table.calcite.CalciteConfig in project flink by apache.

the class TableEnvironmentITCase method testCustomCalciteConfig.

@Test(expected = TableException.class)
public void testCustomCalciteConfig() {
    ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    BatchTableEnvironment tableEnv = TableEnvironment.getTableEnvironment(env, config());
    CalciteConfig cc = new CalciteConfigBuilder().replaceOptRuleSet(RuleSets.ofList()).build();
    tableEnv.getConfig().setCalciteConfig(cc);
    DataSet<Tuple3<Integer, Long, String>> ds = CollectionDataSets.get3TupleDataSet(env);
    Table t = tableEnv.fromDataSet(ds);
    tableEnv.toDataSet(t, Row.class);
}
Also used : ExecutionEnvironment(org.apache.flink.api.java.ExecutionEnvironment) CalciteConfigBuilder(org.apache.flink.table.calcite.CalciteConfigBuilder) Table(org.apache.flink.table.api.Table) CalciteConfig(org.apache.flink.table.calcite.CalciteConfig) Tuple3(org.apache.flink.api.java.tuple.Tuple3) BatchTableEnvironment(org.apache.flink.table.api.java.BatchTableEnvironment) Test(org.junit.Test)

Aggregations

ExecutionEnvironment (org.apache.flink.api.java.ExecutionEnvironment)1 Tuple3 (org.apache.flink.api.java.tuple.Tuple3)1 Table (org.apache.flink.table.api.Table)1 BatchTableEnvironment (org.apache.flink.table.api.java.BatchTableEnvironment)1 CalciteConfig (org.apache.flink.table.calcite.CalciteConfig)1 CalciteConfigBuilder (org.apache.flink.table.calcite.CalciteConfigBuilder)1 Test (org.junit.Test)1