snuyanzin opened a new pull request, #27158: URL: https://github.com/apache/flink/pull/27158
When using cast, Flink uses ExtendedSqlRowTypeNameSpec to derive the row type, and we should change the StructKind from FULLY_QUALIFIED in Calcite to PEEK_FIELDS_NO_EXPAND in Flink. Also if extra cast for nested field happened because of mismatched type with enclosing row it checks whether previous cast should be dropped. The PR is based on the work done by @xuyangzhong at https://github.com/apache/flink/pull/24994 however cherry-picking leads to multiple conflicts, so I just added him as a co-author. ## Brief change log Return a Row type with PEEK_FIELDS_NO_EXPAND as the target type in CAST Drop extra casts for rexFieldAccess ## Verifying this change A number of tests in CalcTest and CalcITTest ## 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]
