Skip to content

Commit 22efb4c

Browse files
committed
Remove BuiltInSqlFunction
1 parent efa6e17 commit 22efb4c

File tree

2 files changed

+10
-260
lines changed

2 files changed

+10
-260
lines changed

flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/functions/BuiltInSqlFunction.java

Lines changed: 0 additions & 239 deletions
This file was deleted.

flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/parser/metadata/TransformSqlOperatorTable.java

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.flink.cdc.runtime.parser.metadata;
1919

2020
import org.apache.flink.cdc.runtime.functions.BuiltInScalarFunction;
21-
import org.apache.flink.cdc.runtime.functions.BuiltInSqlFunction;
2221
import org.apache.flink.cdc.runtime.functions.BuiltInTimestampFunction;
2322

2423
import org.apache.calcite.sql.SqlBinaryOperator;
@@ -42,7 +41,6 @@
4241
import org.apache.calcite.sql.type.SqlTypeName;
4342
import org.apache.calcite.sql.type.SqlTypeTransforms;
4443
import org.apache.calcite.sql.util.ReflectiveSqlOperatorTable;
45-
import org.apache.calcite.sql.validate.SqlMonotonicity;
4644
import org.apache.calcite.sql.validate.SqlNameMatcher;
4745
import org.apache.calcite.sql.validate.SqlNameMatchers;
4846

@@ -215,25 +213,16 @@ public SqlSyntax getSyntax() {
215213
}
216214
};
217215
public static final SqlFunction UNIX_TIMESTAMP =
218-
BuiltInSqlFunction.newBuilder()
219-
.name("UNIX_TIMESTAMP")
220-
.returnType(ReturnTypes.BIGINT_NULLABLE)
221-
.operandTypeChecker(
222-
OperandTypes.or(
223-
OperandTypes.NILADIC,
224-
OperandTypes.family(SqlTypeFamily.CHARACTER),
225-
OperandTypes.family(
226-
SqlTypeFamily.CHARACTER, SqlTypeFamily.CHARACTER)))
227-
.notDeterministic()
228-
.monotonicity(
229-
call -> {
230-
if (call.getOperandCount() == 0) {
231-
return SqlMonotonicity.INCREASING;
232-
} else {
233-
return SqlMonotonicity.NOT_MONOTONIC;
234-
}
235-
})
236-
.build();
216+
new SqlFunction(
217+
"UNIX_TIMESTAMP",
218+
SqlKind.OTHER_FUNCTION,
219+
ReturnTypes.BIGINT_NULLABLE,
220+
null,
221+
OperandTypes.or(
222+
OperandTypes.NILADIC,
223+
OperandTypes.family(SqlTypeFamily.CHARACTER),
224+
OperandTypes.family(SqlTypeFamily.CHARACTER, SqlTypeFamily.CHARACTER)),
225+
SqlFunctionCategory.TIMEDATE);
237226
public static final SqlFunction FROM_UNIXTIME =
238227
new SqlFunction(
239228
"FROM_UNIXTIME",

0 commit comments

Comments
 (0)