@SuppressWarnings("unchecked") private <T> TypeComparator<T> buildComparatorFor(int input, ExecutionConfig executionConfig, TypeInformation<T> typeInformation) { TypeComparator<T> comparator; if (typeInformation instanceof AtomicType) { comparator = ((AtomicType<T>) typeInformation).createComparator(true, executionConfig); } else if (typeInformation instanceof CompositeType) { int[] keyPositions = getKeyColumns(input); boolean[] orders = new boolean[keyPositions.length]; Arrays.fill(orders, true); comparator = ((CompositeType<T>) typeInformation).createComparator(keyPositions, orders, 0, executionConfig); } else { throw new RuntimeException("Type information for input of type " + typeInformation.getClass() .getCanonicalName() + " is not supported. Could not generate a comparator."); } return comparator; }
@SuppressWarnings("unchecked") private <T> TypeComparator<T> buildComparatorFor(int input, ExecutionConfig executionConfig, TypeInformation<T> typeInformation) { TypeComparator<T> comparator; if (typeInformation instanceof AtomicType) { comparator = ((AtomicType<T>) typeInformation).createComparator(true, executionConfig); } else if (typeInformation instanceof CompositeType) { int[] keyPositions = getKeyColumns(input); boolean[] orders = new boolean[keyPositions.length]; Arrays.fill(orders, true); comparator = ((CompositeType<T>) typeInformation).createComparator(keyPositions, orders, 0, executionConfig); } else { throw new RuntimeException("Type information for input of type " + typeInformation.getClass() .getCanonicalName() + " is not supported. Could not generate a comparator."); } return comparator; }
@SuppressWarnings("unchecked") private <T> TypeComparator<T> buildComparatorFor(int input, ExecutionConfig executionConfig, TypeInformation<T> typeInformation) { TypeComparator<T> comparator; if (typeInformation instanceof AtomicType) { comparator = ((AtomicType<T>) typeInformation).createComparator(true, executionConfig); } else if (typeInformation instanceof CompositeType) { int[] keyPositions = getKeyColumns(input); boolean[] orders = new boolean[keyPositions.length]; Arrays.fill(orders, true); comparator = ((CompositeType<T>) typeInformation).createComparator(keyPositions, orders, 0, executionConfig); } else { throw new RuntimeException("Type information for input of type " + typeInformation.getClass() .getCanonicalName() + " is not supported. Could not generate a comparator."); } return comparator; }