Skip to content

[FLINK-38062][table] ENCODE function behaves wrong#26767

Merged
snuyanzin merged 4 commits into
apache:masterfrom
snuyanzin:decode
Jul 8, 2025
Merged

[FLINK-38062][table] ENCODE function behaves wrong#26767
snuyanzin merged 4 commits into
apache:masterfrom
snuyanzin:decode

Conversation

@snuyanzin

Copy link
Copy Markdown
Contributor

What is the purpose of the change

The PR fixes the behavior of ENCODE as mentioned in jira issue

Brief change log

Verifying this change

The test added under MiscFunctionsITCase.java

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): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: ( no )
  • The S3 file system connector: (yes)

Documentation

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

@flinkbot

flinkbot commented Jul 8, 2025

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

@twalthr twalthr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some last nit comments. Feel free to merge afterwards.

@liuyongvs liuyongvs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@snuyanzin

Copy link
Copy Markdown
Contributor Author

Should we remove nullableIfArgs in BuiltInFunctionDefinitions#ENCODE? Same for DECODE.

why ?

SELECT encode(cast(null as string), 'utf-8'), encode(cast(null as string), cast(null as string)), encode('asd', cast(null as string));

returns

null, null, null

or did I miss anything?

@dylanhz

dylanhz commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

Should we remove nullableIfArgs in BuiltInFunctionDefinitions#ENCODE? Same for DECODE.

why ?

SELECT encode(cast(null as string), 'utf-8'), encode(cast(null as string), cast(null as string)), encode('asd', cast(null as string));

returns

null, null, null

or did I miss anything?

I mean the nullability of return types are different in BuiltInFunctionDefinitions and FlinkSqlOperatorTable .

@snuyanzin

Copy link
Copy Markdown
Contributor Author

can you log an issue for that with description and a test case then?
We can continue discussion there and fix if required

@dylanhz

dylanhz commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

can you log an issue for that with description and a test case then?
We can continue discussion there and fix if required

OK. And this pr LGTM.

@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Jul 8, 2025
@snuyanzin snuyanzin merged commit 220f7c5 into apache:master Jul 8, 2025
@snuyanzin snuyanzin deleted the decode branch July 29, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants