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-21912][pyflink] Introduce ResolvedSchema in Python Table API #26121

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

autophagy
Copy link
Contributor

What is the purpose of the change

Currently, ResolvedSchema is not supported in the Python Table API. This PR introduces it, as well as adding get_resolved_schema() to Table and replaces get_table_schema() in TableResult with get_resolved_schema(), similar to ba5b122.

Brief change log

  • ResolvedSchema is introduced to Python Table API.
  • Table.get_resolved_schema() is added.
  • TableResult.get_table_schema() is replaced by TableResult.get_resolved_schema()

Verifying this change

Please make sure both new and modified tests in this PR follow the conventions for tests defined in our code quality guide.

  • This change is already covered by existing tests, such as sql and table environment api tests.
  • This change adds a test to the schema operation tests to verify the returned resolved schema is as expected.

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 (in the sense that it changes the public api of TableResult and Table))
  • 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? (docs)

@flinkbot
Copy link
Collaborator

flinkbot commented Feb 7, 2025

CI report:

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

@autophagy autophagy changed the title [FLINK-21912] Introduce ResolvedSchema in Python Table API [FLINK-21912][pyflink] Introduce ResolvedSchema in Python Table API Feb 10, 2025
@autophagy
Copy link
Contributor Author

I missed some docs updates, will turn this PR back to draft until i've updated them.

@autophagy autophagy marked this pull request as draft February 10, 2025 09:36
@autophagy autophagy marked this pull request as ready for review February 11, 2025 12:06
:class:`pyflink.table.catalog.ComputedColumn`, or :class:`pyflink.table.catalog.MetadataColumn`.

Every column is fully resolved. The enclosed :class:`~pyflink.table.types.DataType`
indicates whether the column is a time attribute and thus might differ from the original
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I am not sure how to read this sentence, what do we mean by original here? and what might be expected to be different around time attributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not entirely sure what is meant, the docs for this class were just pulled from the Java equivalent https://nightlies.apache.org/flink/flink-docs-stable/api/java/org/apache/flink/table/catalog/Column.html - perhaps it's not necessary to include this in the Python one, since it doesn't really 'enclose' the data type like the Java one does.

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