Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-37269][table] Add new DESCRIPTOR type #26144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

twalthr
Copy link
Contributor

@twalthr twalthr commented Feb 11, 2025

What is the purpose of the change

Adds the DESCRIPTOR type to the Flink type system. The DESCRIPTOR type is defined by the SQL standard and necessary for passing a list of column names into PTFs. PTFs will esp. use them for time semantics. Built-in window PTFs already partially supported DESCRIPTORs but were tailored to those window uses cases only. This PR generalizes concepts and cleans up the planner.

Calcite has partial support for DESCRIPTOR but had some bugs in the stack that had to be patched in this PR.

Brief change log

  • Support DescriptorType logical type
  • Support DESCRIPTOR data type in function API incl. annotations
  • Update planner to pass column lists all the way to the function call and its runtime operator

Verifying this change

This change added tests and can be verified as follows: ProcessTableFunctionSemanticTests, ProcessTableFunctionTests,

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): yes
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): yes
  • 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? JavaDocs

@flinkbot
Copy link
Collaborator

flinkbot commented Feb 11, 2025

CI report:

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


// ----- FLINK MODIFICATION BEGIN -----
// COLUMN_LIST is assignable from ...
rules.add(SqlTypeName.COLUMN_LIST, EnumSet.of(SqlTypeName.COLUMN_LIST));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@snuyanzin could you contribute this line to Calcite? Should be an easy PR if not just a hotfix commit.

@@ -252,6 +253,12 @@
* <li>Added in FLINK-34312: Lines 5804 ~ 5813
* <li>Added in FLINK-34057, FLINK-34058, FLINK-34312: Lines 6263 ~ 6279
* </ol>
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we need to update line numbers here

@@ -335,7 +335,7 @@ private DataType extractDataTypeOrError(
// early and helpful exception for common mistakes
checkForCommonErrors(type);

// PREDEFINED
// PREDEFINED and DESCRIPTOR
resultDataType = extractPredefinedType(template, type);
Copy link
Contributor

Choose a reason for hiding this comment

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

given the fact that extract method here and for others contains type, should it be also renamed?

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

Successfully merging this pull request may close these issues.

3 participants