Search in sources :

Example 1 with GeneratedNormalizedKeyComputer

use of org.apache.flink.table.runtime.generated.GeneratedNormalizedKeyComputer in project flink by apache.

the class SortCodeGeneratorTest method getSortBaseWithNulls.

public static Tuple2<NormalizedKeyComputer, RecordComparator> getSortBaseWithNulls(String namePrefix, RowType inputType, SortSpec sortSpec) {
    SortCodeGenerator generator = new SortCodeGenerator(new TableConfig(), inputType, sortSpec);
    GeneratedNormalizedKeyComputer computer = generator.generateNormalizedKeyComputer(namePrefix + "Computer");
    GeneratedRecordComparator comparator = generator.generateRecordComparator(namePrefix + "Comparator");
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    return new Tuple2<>(computer.newInstance(cl), comparator.newInstance(cl));
}
Also used : GeneratedNormalizedKeyComputer(org.apache.flink.table.runtime.generated.GeneratedNormalizedKeyComputer) Tuple2(org.apache.flink.api.java.tuple.Tuple2) TableConfig(org.apache.flink.table.api.TableConfig) SortCodeGenerator(org.apache.flink.table.planner.codegen.sort.SortCodeGenerator) GeneratedRecordComparator(org.apache.flink.table.runtime.generated.GeneratedRecordComparator)

Aggregations

Tuple2 (org.apache.flink.api.java.tuple.Tuple2)1 TableConfig (org.apache.flink.table.api.TableConfig)1 SortCodeGenerator (org.apache.flink.table.planner.codegen.sort.SortCodeGenerator)1 GeneratedNormalizedKeyComputer (org.apache.flink.table.runtime.generated.GeneratedNormalizedKeyComputer)1 GeneratedRecordComparator (org.apache.flink.table.runtime.generated.GeneratedRecordComparator)1