Skip to content

[FLINK-39999][table] Make Flink Sql calls unparsable as it is required by Calcite 1.42.0#28551

Open
snuyanzin wants to merge 5 commits into
apache:masterfrom
snuyanzin:flink39999
Open

[FLINK-39999][table] Make Flink Sql calls unparsable as it is required by Calcite 1.42.0#28551
snuyanzin wants to merge 5 commits into
apache:masterfrom
snuyanzin:flink39999

Conversation

@snuyanzin

Copy link
Copy Markdown
Contributor

What is the purpose of the change

The main reason is CALCITE-7301(https://issues.apache.org/jira/browse/CALCITE-7301) issue which introduced tests for every sql operator to check whether it is unparsable

The PR introduces similar fix and a similar test (in a separate commit to easily revert it once after upgrade Calcite's test could be reused)

Brief change log

parse sql operators

Verifying this change

test introduced

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? (yes )
  • If yes, how is the feature documented? (not applicable)

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

@flinkbot

flinkbot commented Jun 26, 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

@AHeise AHeise 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.

Looks very good. Thank you for fixing.

I have NOT looked at all the different classes but rather a good portion of it. However the fixes to SqlSpecialOperator#createCall are rather mechanical.

What I'm a bit more worried about are the intermittent fixes to #getOperandList. These changes are more subtle with a higher blast radius. Can you do an additional pass over them? I'm also trying to catch them all but they also require some knowledge about the SqlNode.

}

/** Decodes a {@code boolean} field encoded as a {@link SqlLiteral}. */
protected static boolean operandToBoolean(SqlNode operand) {

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.

Any value in doing some assertion on type for better error message? I think it's so deep in the stack that classcast is just fine.

for (String detail : explainDetails) {
details.add(SqlLiteral.createCharString(detail, SqlParserPos.ZERO));
}
return List.of(statement, details);

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.

Is this an unrelated fix? (okay to keep)

@AHeise AHeise 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.

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.

3 participants