Skip to content

[FLINK-39866][table] Remove dead KEYVALUE code from SqlFunctionUtils and StringCallGen#28501

Open
raminqaf wants to merge 1 commit into
apache:masterfrom
raminqaf:FLINK-39866
Open

[FLINK-39866][table] Remove dead KEYVALUE code from SqlFunctionUtils and StringCallGen#28501
raminqaf wants to merge 1 commit into
apache:masterfrom
raminqaf:FLINK-39866

Conversation

@raminqaf

Copy link
Copy Markdown
Contributor

What is the purpose of the change

This is a code cleanup that removes the unreachable KEYVALUE implementation code. KEYVALUE was dropped as a built-in SQL function in FLINK-13547 (Aug 2019) because it is non-standard and covered by STR_TO_MAP(str)[key]. That change removed the operator registration in FlinkSqlOperatorTable and the code-gen dispatch case KEYVALUE => generateKeyValue(...), but left the implementation methods behind. They have had no callers since.

KEYVALUE no longer resolves at all today. A query like SELECT KEYVALUE('a=1,b=2,c=3', ',', '=', 'b') fails at SQL
validation with No match found for function signature KEYVALUE(...), so the leftover methods are never reachable from a
query.

Brief change log

  • Remove StringCallGen.generateKeyValue (no dispatch since FLINK-13547).
  • Remove both SqlFunctionUtils.keyValue overloads.
  • Remove BinaryStringDataUtil.keyValue and its private helpers findValueOfKey, keyValueSlow, findValueOfKeySlow,together with the now-orphaned BinaryStringDataTest#testKeyValue.

Validate Removal

SELECT KEYVALUE('a=1,b=2,c=3', ',', '=', 'b') into WordCountSQLExample and ran it against the unmodified source (orphans still present). Result:

SQL validation failed. From line 1, column 8 to line 1, column 45:
No match found for function signature KEYVALUE(<CHARACTER>, <CHARACTER>, <CHARACTER>, <CHARACTER>)

Verifying this change

This change is a trivial rework / code cleanup without any test coverage. The removed methods had no production callers, and the rest of BinaryStringDataUtil remains covered by BinaryStringDataTest.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@flinkbot

flinkbot commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@raminqaf

Copy link
Copy Markdown
Contributor Author

@flinkbot run azure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants