VasShabu commented on code in PR #29967:
URL: https://github.com/apache/flink/pull/29967#discussion_r4682837292
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/SpecializedFunction.java:
##########
@@ -113,6 +114,52 @@ ExpressionEvaluator createEvaluator(
*/
ExpressionEvaluator createEvaluator(
BuiltInFunctionDefinition function, DataType outputDataType,
DataType... args);
+
+ /**
+ * Creates a serializable comparator for values of the given data
type, which orders them
+ * ascending with NULL before every other value.
+ *
+ * <p>The comparator uses the same ordering as {@code ORDER BY}. A
{@code ROW} type is
+ * compared field by field, and the compared values are {@link
RowData}. Any other type is
+ * compared as a single value. Types that cannot be ordered are
rejected during planning.
+ *
+ * <p>Initialize the comparator in {@link
UserDefinedFunction#open(FunctionContext)} by
+ * calling {@link GeneratedComparator#open(FunctionContext)}.
+ *
+ * @param dataType type of the compared values, which are expected in
the internal data
+ * structure of the type, see {@link DataType#toInternal()}
+ */
+ GeneratedComparator createComparator(DataType dataType);
+ }
+
+ /**
+ * Serializable comparator that can be passed into a {@link
UserDefinedFunction}. An instance is
+ * not thread-safe and must be opened before values are compared.
+ *
+ * @see ExpressionEvaluatorFactory#createComparator(DataType)
+ */
+ @PublicEvolving
+ interface GeneratedComparator extends Serializable {
Review Comment:
I think this is already under SpecializedFunction, please let me know if i
am mistaken
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]