This is an automated email from the ASF dual-hosted git repository. snuyanzin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
commit 115c4fbd7bb760acbc26be3016c09e9b0be4ed68 Author: Ramin Gharib <[email protected]> AuthorDate: Wed Jul 29 16:36:52 2026 +0200 [FLINK-40255][table-planner] Remove duplicate TRY_PARSE_JSON registration TRY_PARSE_JSON was registered twice: once as a BuiltInFunctionDefinition and, redundantly, as a legacy SqlFunction in FlinkSqlOperatorTable. Both were introduced together. PARSE_JSON only got the BuiltInFunctionDefinition, which is where new built-in functions belong. FlinkSqlOperatorTable extends ReflectiveSqlOperatorTable, so declaring the field is enough to register the operator. The planner chains FunctionCatalogOperatorTable ahead of FlinkSqlOperatorTable, so looking up TRY_PARSE_JSON returned two operators. RexNodeJsonDeserializer treats anything other than exactly one match as "not found", so restoring a plan containing TRY_PARSE_JSON failed with "Could not resolve internal system function '$TRY_PARSE_JSON$1'". Planning and execution were un [...] Nothing references the legacy field. Removing it leaves the BuiltInFunctionDefinition as the single registration. --- .../table/planner/functions/sql/FlinkSqlOperatorTable.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java index 32a2a20d679..68c950b867a 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java @@ -1267,20 +1267,6 @@ public class FlinkSqlOperatorTable extends ReflectiveSqlOperatorTable { public static final SqlPostfixOperator IS_NOT_JSON_SCALAR = SqlStdOperatorTable.IS_NOT_JSON_SCALAR; - // VARIANT FUNCTIONS - public static final SqlFunction TRY_PARSE_JSON = - new SqlFunction( - "TRY_PARSE_JSON", - SqlKind.OTHER_FUNCTION, - ReturnTypes.cascade( - ReturnTypes.explicit(SqlTypeName.VARIANT), - SqlTypeTransforms.FORCE_NULLABLE), - null, - OperandTypes.or( - OperandTypes.family(SqlTypeFamily.STRING), - OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.BOOLEAN)), - SqlFunctionCategory.SYSTEM); - // WINDOW TABLE FUNCTIONS // use the definitions in Flink, because we have different return types // and special check on the time attribute.
