autophagy opened a new pull request, #29267: URL: https://github.com/apache/flink/pull/29267
## What is the purpose of the change As part of building the foundation for [FLIP-609](https://cwiki.apache.org/confluence/spaces/FLINK/pages/449286339/FLIP-609+Type+Inference+for+Python+User+Defined+Functions), this PR extracts the Python type inference layer from the Dataframe API into the Table API so that both APIs may be able to use it. As part of the extraction, this PR also changes the default behaviour so that an inferred type is `NOT NULL`, except if wrapped in an `Optional` or if it is an `Any` type. The `Any` type behaviour as mapping to a `STRING` is preserved, though we may want to visit this in future and be more strict about this (denying its use in return type in lieu of a concrete mapping, for example). It also changed the inferred type for `datetime.time` from `TIME(0)` which is second precision to `TIME(3)`, which is milisecond precision. This is the highest precision that survives a roundtrip (though datetime.time carried microseconds, the runtime drops sub-millisecond precision). ## Brief change log - Extracted the PyFlink dataframe API type inference layer into `yflink.table.typehints`. - Changed the default inference for non `Optional` Python types to `NOT NULL`. - Changed the default inference for `datetime.time` from `TIME(0)` to `TIME(3)` to preserve millisecond precision. ## Verifying this change This change is already covered by existing tests, such as `test_udf` and `test_datatype` ## 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) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
