[
https://issues.apache.org/jira/browse/FLINK-39866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18090876#comment-18090876
]
Sergey Nuyanzin commented on FLINK-39866:
-----------------------------------------
Merged as
[dadd8d63e416be1d2db9c25c6497189b902c7dcd|https://github.com/apache/flink/commit/dadd8d63e416be1d2db9c25c6497189b902c7dcd]
> Remove dead KEYVALUE code from SqlFunctionUtils and StringCallGen
> -----------------------------------------------------------------
>
> Key: FLINK-39866
> URL: https://issues.apache.org/jira/browse/FLINK-39866
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Planner, Table SQL / Runtime
> Reporter: Ramin Gharib
> Assignee: Ramin Gharib
> Priority: Minor
> Labels: pull-request-available
>
> FLINK-13547 removed support of `KEYVALUE()` method (commit cc234187794, Aug
> 2019): "Remove LENGTH(), JSONVALUE(), KEYVALUE(), SUBSTR() builtin functions
> which are not standard."
> The {{KEYVALUE}} codepath is orphaned. There is no SQL operator for it, no
> codegen dispatch, and no documentation. {{StringCallGen.generateKeyValue}}
> has no callers, so neither {{SqlFunctionUtils.keyValue}} overload (the
> {{BinaryStringData}} form at ~line 499 and the String form at ~line 523) is
> reachable from any query.
> Remove {{StringCallGen.generateKeyValue}} and both
> {{SqlFunctionUtils.keyValue}} overloads. {{BinaryStringDataUtil.keyValue}} is
> otherwise referenced only by {{{}BinaryStringDataTest{}}}; decide whether to
> keep it with its unit test or remove both together.
> h3. Validate Removal
> {{SELECT KEYVALUE('a=1,b=2,c=3', ',', '=', 'b')}} into
> {{WordCountSQLExample}} and ran it against the unmodified source (orphans
> still present). Result:
> {code:java}
> SQL validation failed. From line 1, column 8 to line 1, column 45:
> No match found for function signature KEYVALUE(<CHARACTER>, <CHARACTER>,
> <CHARACTER>, <CHARACTER>){code}
> It dies at validation, before code-gen. The orphaned generateKeyValue is
> never reachable, so {{KEYVALUE}} does not work at all.
> The replacement {{STR_TO_MAP('a=1,b=2,c=3', ',', '=')['b'] }}passed
> validation cleanly in the same harness.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)