You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/10/19 12:56:56 UTC

[GitHub] [flink] slinkydeveloper opened a new pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

slinkydeveloper opened a new pull request #17522:
URL: https://github.com/apache/flink/pull/17522


   Signed-off-by: slinkydeveloper <fr...@gmail.com>
   
   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   The goal of this PR is to add new interfaces to reorganize the casting throughout the Table API implementation.
   
   The new interface called `CastRule` provides a flexible way to implement casting logic for different input and target `LogicalType`s. `CastRule` encapsulates the casting logic and its matching logic, which could be a match of one or multiple input and target types, type families or a custom predicate.
   
   A subinterface of `CastRule` called `CodeGeneratorCastRule` allows to implement casting through code generation, in order to retain the same performance characteristics we have in our code generator, but unifying the code base and improving the code organization. A default implementation to create an executable version of the casting logic is provided through janino `ExpressionEvaluator` feature.
   
   Having both a "callable" casting rule and a "code generating" cast rule allows us to:
   
   * Improve code generation codebase quality
   * Reuse the same to string casting logic in `PrintUtils`
   * Allow us in future to fix the constant folding for casting (see https://issues.apache.org/jira/browse/FLINK-24588 for more details)
   
   ## Brief change log
   
   - Introduce the new interfaces `CastRule`, `CastExecutor`, `CodeGeneratorCastRule` and relative subinterfaces/base classes
   - Provide a `CastRuleProvider` to discover cast rules
   - Wired the new cast rules to the code generation
   - Added a couple of rules to show how to implement them
   
   ## Verifying this change
   
   A new test `CastRulesTest` is added to unit test the cast rules. The e2e tests are provided by `CastFunctionITCase`.
   
   ## 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? no
   


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "953874367",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "953959485",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * ec3a0972e352ea5439c09043cc0c02a91c063cc2 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737473070



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratorCastRule.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Cast rule that has code generation capabilities.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CodeGeneratorCastRule<IN, OUT> extends CastRule<IN, OUT> {
+
+    /**
+     * Generates a code block composed by different statements performing the casting. The returned
+     * code block must have a variable containing the result and an isNull term.
+     */
+    CastCodeBlock generateCodeBlock(
+            Context context,
+            String inputTerm,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType);
+
+    /** Context for code generation. */
+    interface Context {
+        /** @return the session time zone term */
+        String getSessionTimeZoneTerm();
+
+        /**
+         * Declare a new variable in the global scope.
+         *
+         * @return the variable name
+         */
+        String declareVariable(String type, String variablePrefix);
+
+        default String declareVariable(LogicalType type, String variablePrefix) {
+            return declareVariable(

Review comment:
       Ok I remove it now and then we can add it later if we need it, thinking to a proper name for it




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   * 1740f472b8e16bf6759756822d177b60f3b0c42c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   * 1740f472b8e16bf6759756822d177b60f3b0c42c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r738188359



##########
File path: flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/expressions/TemporalTypesTest.scala
##########
@@ -470,196 +470,196 @@ class TemporalTypesTest extends ExpressionTestBase {
 
   @Test
   def testTimeIntervalArithmetic(): Unit = {
-
-    // interval months comparison
-
-    testAllApis(
-      12.months < 24.months,
-      "INTERVAL '12' MONTH < INTERVAL '24' MONTH",
-      "true")
-
-    testAllApis(
-      8.years === 8.years,
-      "INTERVAL '8' YEAR = INTERVAL '8' YEAR",
-      "true")
-
-    // interval millis comparison
-
-    testAllApis(
-      8.millis > 10.millis,
-      "INTERVAL '0.008' SECOND > INTERVAL '0.010' SECOND",
-      "false")
-
-    testAllApis(
-      8.millis === 8.millis,
-      "INTERVAL '0.008' SECOND = INTERVAL '0.008' SECOND",
-      "true")
-
-    // interval months addition/subtraction
-
-    testAllApis(
-      8.years + 10.months,
-      "INTERVAL '8' YEAR + INTERVAL '10' MONTH",
-      "+8-10")
-
-    testAllApis(
-      2.years - 12.months,
-      "INTERVAL '2' YEAR - INTERVAL '12' MONTH",
-      "+1-00")
-
-    testAllApis(
-      -2.years,
-      "-INTERVAL '2' YEAR",
-      "-2-00")
-
-    // interval millis addition/subtraction
-
-    testAllApis(
-      8.hours + 10.minutes + 12.seconds + 5.millis,
-      "INTERVAL '8' HOUR + INTERVAL '10' MINUTE + INTERVAL '12.005' SECOND",
-      "+0 08:10:12.005")
-
-    testAllApis(
-      1.minute - 10.seconds,
-      "INTERVAL '1' MINUTE - INTERVAL '10' SECOND",
-      "+0 00:00:50.000")
-
-    testAllApis(
-      -10.seconds,
-      "-INTERVAL '10' SECOND",
-      "-0 00:00:10.000")
-
-    // addition to date
-
-    // interval millis
-    testAllApis(
-      'f0 + 2.days,
-      "f0 + INTERVAL '2' DAY",
-      "1990-10-16")
-
-    // interval millis
-    testAllApis(
-      30.days + 'f0,
-      "INTERVAL '30' DAY + f0",
-      "1990-11-13")
-
-    // interval months
-    testAllApis(
-      'f0 + 2.months,
-      "f0 + INTERVAL '2' MONTH",
-      "1990-12-14")
-
-    // interval months
-    testAllApis(
-      2.months + 'f0,
-      "INTERVAL '2' MONTH + f0",
-      "1990-12-14")
-
-    // addition to time
-
-    // interval millis
-    testAllApis(
-      'f1 + 12.hours,
-      "f1 + INTERVAL '12' HOUR",
-      "22:20:45")
-
-    // interval millis
-    testAllApis(
-      12.hours + 'f1,
-      "INTERVAL '12' HOUR + f1",
-      "22:20:45")
-
-    // addition to timestamp
-
-    // interval millis
-    testAllApis(
-      'f2 + 10.days + 4.millis,
-      "f2 + INTERVAL '10 00:00:00.004' DAY TO SECOND",
-      "1990-10-24 10:20:45.127")
-
-    // interval millis
-    testAllApis(
-      10.days + 'f2 + 4.millis,
-      "INTERVAL '10 00:00:00.004' DAY TO SECOND + f2",
-      "1990-10-24 10:20:45.127")
-
-    // interval months
-    testAllApis(
-      'f2 + 10.years,
-      "f2 + INTERVAL '10' YEAR",
-      "2000-10-14 10:20:45.123")
-
-    // interval months
-    testAllApis(
-      10.years + 'f2,
-      "INTERVAL '10' YEAR + f2",
-      "2000-10-14 10:20:45.123")
-
-    // subtraction from date
-
-    // interval millis
-    testAllApis(
-      'f0 - 2.days,
-      "f0 - INTERVAL '2' DAY",
-      "1990-10-12")
-
-    // interval millis
-    testAllApis(
-      -30.days + 'f0,
-      "INTERVAL '-30' DAY + f0",
-      "1990-09-14")
-
-    // interval months
-    testAllApis(
-      'f0 - 2.months,
-      "f0 - INTERVAL '2' MONTH",
-      "1990-08-14")
-
-    // interval months
-    testAllApis(
-      -2.months + 'f0,
-      "-INTERVAL '2' MONTH + f0",
-      "1990-08-14")
-
-    // subtraction from time
-
-    // interval millis
-    testAllApis(
-      'f1 - 12.hours,
-      "f1 - INTERVAL '12' HOUR",
-      "22:20:45")
-
-    // interval millis
-    testAllApis(
-      -12.hours + 'f1,
-      "INTERVAL '-12' HOUR + f1",
-      "22:20:45")
-
-    // subtraction from timestamp
-
-    // interval millis
-    testAllApis(
-      'f2 - 10.days - 4.millis,
-      "f2 - INTERVAL '10 00:00:00.004' DAY TO SECOND",
-      "1990-10-04 10:20:45.119")
-
-    // interval millis
-    testAllApis(
-      -10.days + 'f2 - 4.millis,
-      "INTERVAL '-10 00:00:00.004' DAY TO SECOND + f2",
-      "1990-10-04 10:20:45.119")
-
-    // interval months
-    testAllApis(
-      'f2 - 10.years,
-      "f2 - INTERVAL '10' YEAR",
-      "1980-10-14 10:20:45.123")
-
-    // interval months
-    testAllApis(
-      -10.years + 'f2,
-      "INTERVAL '-10' YEAR + f2",
-      "1980-10-14 10:20:45.123")
+//

Review comment:
       undo this change?




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d16cc0f9e2290406d788453db9f771fe6cbc8637 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283) 
   * ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] matriv commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
matriv commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r732782351



##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/data/casting/CastRulesTest.java
##########
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.table.data.StringData;
+import org.apache.flink.table.data.TimestampData;
+import org.apache.flink.table.types.DataType;
+
+import org.junit.jupiter.api.DynamicTest;
+import org.junit.jupiter.api.TestFactory;
+
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.apache.flink.table.api.DataTypes.BIGINT;
+import static org.apache.flink.table.api.DataTypes.INT;
+import static org.apache.flink.table.api.DataTypes.SMALLINT;
+import static org.apache.flink.table.api.DataTypes.STRING;
+import static org.apache.flink.table.api.DataTypes.TIMESTAMP;
+import static org.apache.flink.table.api.DataTypes.TIMESTAMP_LTZ;
+import static org.apache.flink.table.api.DataTypes.TINYINT;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+class CastRulesTest {

Review comment:
       nit: Maybe add a class comment, linking to `CastFunctionITCase` and the opposite so that folks can easily jump back and forth from the unitTests to the ITTests.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266) 
   * 2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r736613111



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CastRuleProvider.java
##########
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.functions.casting.rules.ArrayToArrayCastRule;
+import org.apache.flink.table.planner.functions.casting.rules.IdentityCastRule;
+import org.apache.flink.table.planner.functions.casting.rules.TimestampToStringCastRule;
+import org.apache.flink.table.planner.functions.casting.rules.UpcastToBigIntCastRule;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} using the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input type and target type. Returns {@code null}
+     * if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(LogicalType inputType, LogicalType targetType) {
+        return INSTANCE.internalResolve(inputType, targetType);
+    }
+
+    /** @see #resolve(LogicalType, LogicalType) */
+    public static @Nullable CastRule<?, ?> resolve(
+            DataType inputDataType, DataType targetDataType) {
+        return resolve(inputDataType.getLogicalType(), targetDataType.getLogicalType());
+    }
+
+    /* ------ Implementation ------ */
+
+    private static final CastRuleProvider INSTANCE = new CastRuleProvider();
+
+    static {

Review comment:
       move this to the top of the class to have it more prominent for readers searching for the list

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractCodeGeneratorCastRule.java
##########
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRule;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.generated.CompileUtils;
+import org.apache.flink.table.runtime.typeutils.InternalSerializers;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.AbstractMap.SimpleImmutableEntry;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * Base class for {@link CastRule} supporting code generation. This base class implements {@link
+ * #create(CastRule.Context, LogicalType, LogicalType)} compiling the generated code block into a
+ * {@link CastExecutor} implementation.
+ *
+ * <p>We suggest implementing {@link CodeGeneratorCastRule} starting from {@link

Review comment:
       nit: who is `We`? In this case, just write `It is suggested...`

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratorCastRule.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Cast rule that has code generation capabilities.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CodeGeneratorCastRule<IN, OUT> extends CastRule<IN, OUT> {
+
+    /**
+     * Generates a code block composed by different statements performing the casting. The returned
+     * code block must have a variable containing the result and an isNull term.

Review comment:
       you can directly reference `CastCodeBlock#result`

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && target.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && isValidArrayCasting(
+                                                        ((ArrayType) input).getElementType(),
+                                                        ((ArrayType) target).getElementType()))
+                        .build());
+    }
+
+    private static boolean isValidArrayCasting(
+            LogicalType innerInputType, LogicalType innerTargetType) {
+        return CastRuleProvider.resolve(innerInputType, innerTargetType) != null;

Review comment:
       This assumes that only casts that have been ported to the new cast rule structure are support yet, right? No, `ARRAY<INT>` to `ARRAY<DECIMAL<20, 10>`?

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/TimestampToStringCastRule.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.TimestampData;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.functions.SqlDateTimeUtils;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+import org.apache.flink.table.types.logical.utils.LogicalTypeChecks;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.calls.BuiltInMethods.TIMESTAMP_TO_STRING_TIME_ZONE;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+
+/** Timestamp and timestamp ltz casting to string. */
+@Internal
+public class TimestampToStringCastRule extends AbstractCharacterFamilyTargetRule<TimestampData> {
+
+    public static final TimestampToStringCastRule INSTANCE = new TimestampToStringCastRule();
+
+    private TimestampToStringCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .input(LogicalTypeFamily.TIMESTAMP)
+                        .target(LogicalTypeFamily.CHARACTER_STRING)
+                        .build());
+    }
+
+    @Override
+    public String generateStringExpression(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        String zoneId =
+                (inputLogicalType.getTypeRoot() == LogicalTypeRoot.TIMESTAMP_WITH_LOCAL_TIME_ZONE)

Review comment:
       use `LogicalType.is`

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractNullAwareCodeGeneratorCastRule.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Base class for cast rules supporting code generation. This class inherits from {@link
+ * AbstractCodeGeneratorCastRule} and takes care of nullability checks.
+ */
+@Internal
+public abstract class AbstractNullAwareCodeGeneratorCastRule<IN, OUT>
+        extends AbstractCodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractNullAwareCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    /**
+     * This method doesn't need to take care of null checks handling of input values.
+     * Implementations should write the cast result in the {@code returnVariable}.
+     */
+    protected abstract String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType);
+
+    @Override
+    public CastCodeBlock generateCodeBlock(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            LogicalType inputType,
+            LogicalType targetType) {
+        StringBuilder resultCode = new StringBuilder();
+
+        // Result of a casting can be null only and only if the input is null
+        boolean isResultNullable = inputType.isNullable();
+        String nullTerm;
+        if (isResultNullable) {
+            nullTerm = context.declareVariable("boolean", "isNull");
+            resultCode.append(nullTerm).append(" = ").append(inputTerm).append(" == null;\n");
+        } else {
+            nullTerm = "false";
+        }
+
+        // Create the result value variable
+        String returnTerm = context.declareVariable(targetType, "result");
+
+        // Generate the code block
+        String castCodeBlock =
+                this.generateCodeBlockInternal(
+                        context, inputTerm, returnTerm, inputType, targetType);
+
+        if (isResultNullable) {
+            resultCode
+                    .append("if (!")

Review comment:
       sometimes you use `StringBuilder` and sometime `+`. Shall we keep https://github.com/apache/flink/pull/17522/files#diff-f6381501ccb5f995a532369eafaaa4d3b0f34bda58e9519216753bfb35e35558R104 consistent

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && target.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && isValidArrayCasting(

Review comment:
       also check `LogicalTypeCasts.supportsExplicitCast`.
   
   Also to check: Is some of the higher levels in the call stack checking for `LogicalTypeCasts.supportsAvoidingCast`? Because e.g. a `ROW<a STRING>` and `ROW<b STRING>` don't need a cast.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractCodeGeneratorCastRule.java
##########
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRule;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.generated.CompileUtils;
+import org.apache.flink.table.runtime.typeutils.InternalSerializers;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.AbstractMap.SimpleImmutableEntry;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * Base class for {@link CastRule} supporting code generation. This base class implements {@link
+ * #create(CastRule.Context, LogicalType, LogicalType)} compiling the generated code block into a
+ * {@link CastExecutor} implementation.
+ *
+ * <p>We suggest implementing {@link CodeGeneratorCastRule} starting from {@link
+ * AbstractNullAwareCodeGeneratorCastRule}, which provides nullability checks, or from {@link
+ * AbstractExpressionCodeGeneratorCastRule} to generate simple expression casts.
+ */
+public abstract class AbstractCodeGeneratorCastRule<IN, OUT> extends AbstractCastRule<IN, OUT>

Review comment:
       Make sure to add `@Internal` annotations to all new classes. This should become a habit similar to adding a license header.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractCodeGeneratorCastRule.java
##########
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRule;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.generated.CompileUtils;
+import org.apache.flink.table.runtime.typeutils.InternalSerializers;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.AbstractMap.SimpleImmutableEntry;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * Base class for {@link CastRule} supporting code generation. This base class implements {@link
+ * #create(CastRule.Context, LogicalType, LogicalType)} compiling the generated code block into a
+ * {@link CastExecutor} implementation.
+ *
+ * <p>We suggest implementing {@link CodeGeneratorCastRule} starting from {@link
+ * AbstractNullAwareCodeGeneratorCastRule}, which provides nullability checks, or from {@link
+ * AbstractExpressionCodeGeneratorCastRule} to generate simple expression casts.
+ */
+public abstract class AbstractCodeGeneratorCastRule<IN, OUT> extends AbstractCastRule<IN, OUT>
+        implements CodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CastExecutor<IN, OUT> create(
+            CastRule.Context castRuleContext,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        final String inputTerm = "_myInput";
+        final String className = CodeGenUtils.newName("GeneratedCastExecutor");
+        final String inputTypeTerm = CodeGenUtils.boxedTypeTermForType(inputLogicalType);
+        final String targetTypeTerm = CodeGenUtils.boxedTypeTermForType(targetLogicalType);
+
+        final CastExecutorCodeGeneratorContext ctx =
+                new CastExecutorCodeGeneratorContext(castRuleContext);
+        final CastCodeBlock codeBlock =
+                generateCodeBlock(ctx, inputTerm, inputLogicalType, targetLogicalType);
+
+        // Class fields can contain type serializers
+        final String classFieldDecls =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "private final TypeSerializer " + name + ";\n")

Review comment:
       `CodeGenUtils.className`?

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CastRuleProvider.java
##########
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.functions.casting.rules.ArrayToArrayCastRule;
+import org.apache.flink.table.planner.functions.casting.rules.IdentityCastRule;
+import org.apache.flink.table.planner.functions.casting.rules.TimestampToStringCastRule;
+import org.apache.flink.table.planner.functions.casting.rules.UpcastToBigIntCastRule;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} using the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input type and target type. Returns {@code null}
+     * if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(LogicalType inputType, LogicalType targetType) {
+        return INSTANCE.internalResolve(inputType, targetType);
+    }
+
+    /** @see #resolve(LogicalType, LogicalType) */
+    public static @Nullable CastRule<?, ?> resolve(

Review comment:
       drop this method, not used by production code

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratorCastRule.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Cast rule that has code generation capabilities.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CodeGeneratorCastRule<IN, OUT> extends CastRule<IN, OUT> {
+
+    /**
+     * Generates a code block composed by different statements performing the casting. The returned
+     * code block must have a variable containing the result and an isNull term.
+     */
+    CastCodeBlock generateCodeBlock(
+            Context context,
+            String inputTerm,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType);
+
+    /** Context for code generation. */
+    interface Context {
+        /** @return the session time zone term */
+        String getSessionTimeZoneTerm();
+
+        /**
+         * Declare a new variable in the global scope.
+         *
+         * @return the variable name
+         */
+        String declareVariable(String type, String variablePrefix);
+
+        default String declareVariable(LogicalType type, String variablePrefix) {
+            return declareVariable(

Review comment:
       there might be a misunderstanding here. even nullable types should be primitive, it depends on the use case where the generated code is used. `LogicalType` nullability and the concept of boxed/primitive are independent.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && target.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && isValidArrayCasting(
+                                                        ((ArrayType) input).getElementType(),
+                                                        ((ArrayType) target).getElementType()))
+                        .build());
+    }
+
+    private static boolean isValidArrayCasting(
+            LogicalType innerInputType, LogicalType innerTargetType) {
+        return CastRuleProvider.resolve(innerInputType, innerTargetType) != null;
+    }
+
+    @SuppressWarnings("rawtypes")
+    @Override
+    protected String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        LogicalType innerInputType = ((ArrayType) inputLogicalType).getElementType();
+        LogicalType innerTargetType = ((ArrayType) targetLogicalType).getElementType();
+
+        String innerTargetTypeTerm = arrayElementType(innerTargetType);
+        String arraySize = inputTerm + ".size()";
+        String objArrayTerm = newName("objArray");
+
+        CodeGeneratorCastRule<?, ?> innerCastRule =
+                (CodeGeneratorCastRule) CastRuleProvider.resolve(innerInputType, innerTargetType);
+
+        StringBuilder result = new StringBuilder();
+        result.append(
+                innerTargetTypeTerm
+                        + "[] "
+                        + objArrayTerm
+                        + " = new "
+                        + innerTargetTypeTerm
+                        + "["
+                        + arraySize
+                        + "];\n");
+
+        result.append("for (int i = 0; i < " + arraySize + "; i++) {\n");
+        CastCodeBlock codeBlock =
+                innerCastRule.generateCodeBlock(
+                        context,
+                        inputTerm + "." + getArrayElement(innerInputType, "i"),
+                        innerInputType.copy(false), // Null check is done at the array access level
+                        innerTargetType);
+
+        String innerElementCode =
+                codeBlock.getCode()
+                        + "\n"
+                        + objArrayTerm
+                        + "[i] = "
+                        + codeBlock.getReturnTerm()
+                        + ";\n";
+
+        // Add null check if inner type is nullable
+        if (innerInputType.isNullable()) {
+            result.append("if (" + inputTerm + ".isNullAt(i)) {\n")
+                    .append(objArrayTerm + "[i] = null;\n")
+                    .append("} else {\n")
+                    .append(innerElementCode)
+                    .append("}\n");
+        } else {
+            result.append(innerElementCode);
+        }
+
+        result.append("}\n");
+
+        result.append(
+                returnVariable
+                        + " = new "
+                        + className(GenericArrayData.class)
+                        + "("
+                        + objArrayTerm
+                        + ");\n");
+
+        return result.toString();
+    }
+
+    private static String arrayElementType(LogicalType t) {
+        if (t.isNullable()) {
+            return "Object";
+        }
+        switch (t.getTypeRoot()) {
+            case BOOLEAN:
+                return "boolean";
+            case TINYINT:
+                return "byte";
+            case SMALLINT:
+                return "short";
+            case INTEGER:
+            case DATE:
+            case TIME_WITHOUT_TIME_ZONE:
+            case INTERVAL_YEAR_MONTH:
+                return "int";
+            case BIGINT:
+            case INTERVAL_DAY_TIME:
+                return "long";
+            case FLOAT:
+                return "float";
+            case DOUBLE:
+                return "double";
+            case DISTINCT_TYPE:
+                return arrayElementType(((DistinctType) t).getSourceType());
+        }
+        return "Object";
+    }
+
+    private static String getArrayElement(LogicalType elementType, String indexVar) {

Review comment:
       some here: don't we have this already somewhere?

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && target.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && isValidArrayCasting(
+                                                        ((ArrayType) input).getElementType(),
+                                                        ((ArrayType) target).getElementType()))
+                        .build());
+    }
+
+    private static boolean isValidArrayCasting(
+            LogicalType innerInputType, LogicalType innerTargetType) {
+        return CastRuleProvider.resolve(innerInputType, innerTargetType) != null;
+    }
+
+    @SuppressWarnings("rawtypes")
+    @Override
+    protected String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        LogicalType innerInputType = ((ArrayType) inputLogicalType).getElementType();
+        LogicalType innerTargetType = ((ArrayType) targetLogicalType).getElementType();
+
+        String innerTargetTypeTerm = arrayElementType(innerTargetType);
+        String arraySize = inputTerm + ".size()";
+        String objArrayTerm = newName("objArray");
+
+        CodeGeneratorCastRule<?, ?> innerCastRule =
+                (CodeGeneratorCastRule) CastRuleProvider.resolve(innerInputType, innerTargetType);
+
+        StringBuilder result = new StringBuilder();
+        result.append(
+                innerTargetTypeTerm
+                        + "[] "
+                        + objArrayTerm
+                        + " = new "
+                        + innerTargetTypeTerm
+                        + "["
+                        + arraySize
+                        + "];\n");
+
+        result.append("for (int i = 0; i < " + arraySize + "; i++) {\n");
+        CastCodeBlock codeBlock =
+                innerCastRule.generateCodeBlock(
+                        context,
+                        inputTerm + "." + getArrayElement(innerInputType, "i"),
+                        innerInputType.copy(false), // Null check is done at the array access level
+                        innerTargetType);
+
+        String innerElementCode =
+                codeBlock.getCode()
+                        + "\n"
+                        + objArrayTerm
+                        + "[i] = "
+                        + codeBlock.getReturnTerm()
+                        + ";\n";
+
+        // Add null check if inner type is nullable
+        if (innerInputType.isNullable()) {
+            result.append("if (" + inputTerm + ".isNullAt(i)) {\n")
+                    .append(objArrayTerm + "[i] = null;\n")
+                    .append("} else {\n")
+                    .append(innerElementCode)
+                    .append("}\n");
+        } else {
+            result.append(innerElementCode);
+        }
+
+        result.append("}\n");
+
+        result.append(
+                returnVariable
+                        + " = new "
+                        + className(GenericArrayData.class)
+                        + "("
+                        + objArrayTerm
+                        + ");\n");
+
+        return result.toString();
+    }
+
+    private static String arrayElementType(LogicalType t) {

Review comment:
       I'm sure we have this switch/case already in existing utils. We should avoid duplicate code.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractCodeGeneratorCastRule.java
##########
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRule;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.generated.CompileUtils;
+import org.apache.flink.table.runtime.typeutils.InternalSerializers;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.AbstractMap.SimpleImmutableEntry;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * Base class for {@link CastRule} supporting code generation. This base class implements {@link
+ * #create(CastRule.Context, LogicalType, LogicalType)} compiling the generated code block into a
+ * {@link CastExecutor} implementation.
+ *
+ * <p>We suggest implementing {@link CodeGeneratorCastRule} starting from {@link
+ * AbstractNullAwareCodeGeneratorCastRule}, which provides nullability checks, or from {@link
+ * AbstractExpressionCodeGeneratorCastRule} to generate simple expression casts.
+ */
+public abstract class AbstractCodeGeneratorCastRule<IN, OUT> extends AbstractCastRule<IN, OUT>
+        implements CodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CastExecutor<IN, OUT> create(
+            CastRule.Context castRuleContext,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        final String inputTerm = "_myInput";
+        final String className = CodeGenUtils.newName("GeneratedCastExecutor");
+        final String inputTypeTerm = CodeGenUtils.boxedTypeTermForType(inputLogicalType);
+        final String targetTypeTerm = CodeGenUtils.boxedTypeTermForType(targetLogicalType);
+
+        final CastExecutorCodeGeneratorContext ctx =
+                new CastExecutorCodeGeneratorContext(castRuleContext);
+        final CastCodeBlock codeBlock =
+                generateCodeBlock(ctx, inputTerm, inputLogicalType, targetLogicalType);
+
+        // Class fields can contain type serializers
+        final String classFieldDecls =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "private final TypeSerializer " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        final String constructorSignature =
+                "public "
+                        + className
+                        + "("
+                        + ctx.getDeclaredTypeSerializers().stream()
+                                .map(name -> "TypeSerializer " + name)
+                                .collect(Collectors.joining(", "))
+                        + ")";
+        final String constructorBody =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "this." + name + " = " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        // Because janino doesn't support generics, we need to manually cast the input variable of
+        // the cast method
+        final String functionSignature =
+                "@Override public Object cast(Object _myInputObj) throws "
+                        + CodeGenUtils.className(TableException.class);
+        final String inputVarDecl =
+                inputTypeTerm + " " + inputTerm + " = (" + inputTypeTerm + ") _myInputObj;\n";
+
+        final String returnStmt = "return " + codeBlock.getReturnTerm() + ";\n";
+
+        final String classCode =

Review comment:
       checkstyle allow to use comments for disabling, not sure about spotless

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratorCastRule.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Cast rule that has code generation capabilities.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CodeGeneratorCastRule<IN, OUT> extends CastRule<IN, OUT> {
+
+    /**
+     * Generates a code block composed by different statements performing the casting. The returned
+     * code block must have a variable containing the result and an isNull term.
+     */
+    CastCodeBlock generateCodeBlock(
+            Context context,
+            String inputTerm,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType);
+
+    /** Context for code generation. */
+    interface Context {
+        /** @return the session time zone term */
+        String getSessionTimeZoneTerm();
+
+        /**
+         * Declare a new variable in the global scope.
+         *
+         * @return the variable name
+         */
+        String declareVariable(String type, String variablePrefix);

Review comment:
       We should avoid unnecessary JavaDocs. When you write `new variable in the global scope` then why not calling the method `declareGlobalVariable`? In the end only the `@return` might be interesting.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY

Review comment:
       use the new `.is()`

##########
File path: flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/typeutils/ArrayDataSerializer.java
##########
@@ -125,7 +125,9 @@ private GenericArrayData copyGenericArray(GenericArrayData array) {
                                     LogicalTypeUtils.toInternalConversionClass(eleType),
                                     array.size());
             for (int i = 0; i < array.size(); i++) {
-                newArray[i] = eleSer.copy(objectArray[i]);
+                if (objectArray[i] != null) {

Review comment:
       this is a change in a very crucial component. it can simply fall through during a review of a 2K PR. please put such changes in a separate commit. 

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/IdentityCastRule.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.util.Objects;
+
+/** Identity casting rule. */
+@Internal
+public class IdentityCastRule extends AbstractCodeGeneratorCastRule<Object, Object> {
+
+    public static final IdentityCastRule INSTANCE = new IdentityCastRule();
+
+    private IdentityCastRule() {
+        super(CastRulePredicate.builder().predicate(Objects::equals).build());
+    }
+
+    @Override
+    public CastCodeBlock generateCodeBlock(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        String isNullTerm = inputLogicalType.isNullable() ? "(" + inputTerm + " == null)" : "false";
+        return new CastCodeBlock("", inputTerm, isNullTerm);

Review comment:
       this means that identity casting is more expensive than before, right? Because we need to box for the interface.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CastCodeBlock.java
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+
+import java.util.Objects;
+
+/**
+ * Generated cast code block result. This POJO contains the Java code of the block performing the
+ * cast, the output isNull term and the output variable containing the cast result. It is guaranteed
+ * that the result and isNull variables can be accessed within the outside scope of the code.

Review comment:
       Use `{@code result} and {@code isNull}`.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractCodeGeneratorCastRule.java
##########
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRule;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.generated.CompileUtils;
+import org.apache.flink.table.runtime.typeutils.InternalSerializers;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.AbstractMap.SimpleImmutableEntry;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * Base class for {@link CastRule} supporting code generation. This base class implements {@link
+ * #create(CastRule.Context, LogicalType, LogicalType)} compiling the generated code block into a
+ * {@link CastExecutor} implementation.
+ *
+ * <p>We suggest implementing {@link CodeGeneratorCastRule} starting from {@link
+ * AbstractNullAwareCodeGeneratorCastRule}, which provides nullability checks, or from {@link
+ * AbstractExpressionCodeGeneratorCastRule} to generate simple expression casts.
+ */
+public abstract class AbstractCodeGeneratorCastRule<IN, OUT> extends AbstractCastRule<IN, OUT>
+        implements CodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CastExecutor<IN, OUT> create(
+            CastRule.Context castRuleContext,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        final String inputTerm = "_myInput";
+        final String className = CodeGenUtils.newName("GeneratedCastExecutor");
+        final String inputTypeTerm = CodeGenUtils.boxedTypeTermForType(inputLogicalType);
+        final String targetTypeTerm = CodeGenUtils.boxedTypeTermForType(targetLogicalType);
+
+        final CastExecutorCodeGeneratorContext ctx =
+                new CastExecutorCodeGeneratorContext(castRuleContext);
+        final CastCodeBlock codeBlock =
+                generateCodeBlock(ctx, inputTerm, inputLogicalType, targetLogicalType);
+
+        // Class fields can contain type serializers
+        final String classFieldDecls =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "private final TypeSerializer " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        final String constructorSignature =
+                "public "
+                        + className
+                        + "("
+                        + ctx.getDeclaredTypeSerializers().stream()
+                                .map(name -> "TypeSerializer " + name)
+                                .collect(Collectors.joining(", "))
+                        + ")";
+        final String constructorBody =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "this." + name + " = " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        // Because janino doesn't support generics, we need to manually cast the input variable of
+        // the cast method
+        final String functionSignature =
+                "@Override public Object cast(Object _myInputObj) throws "
+                        + CodeGenUtils.className(TableException.class);
+        final String inputVarDecl =
+                inputTypeTerm + " " + inputTerm + " = (" + inputTypeTerm + ") _myInputObj;\n";
+
+        final String returnStmt = "return " + codeBlock.getReturnTerm() + ";\n";
+
+        final String classCode =
+                "public final class "
+                        + className
+                        + " implements "
+                        + CodeGenUtils.className(CastExecutor.class)
+                        + " {\n"
+                        + classFieldDecls
+                        + constructorSignature
+                        + " {\n"
+                        + constructorBody
+                        + "}\n"
+                        + functionSignature
+                        + "{\n"
+                        + inputVarDecl
+                        + String.join("\n", ctx.variableDeclarationStatements)
+                        + codeBlock.getCode()
+                        + "\n"
+                        + returnStmt
+                        + "}\n}";
+
+        try {
+            Object[] constructorArgs =
+                    ctx.getTypeSerializersInstances().toArray(new TypeSerializer[0]);
+            return (CastExecutor<IN, OUT>)
+                    CompileUtils.compile(
+                                    Thread.currentThread().getContextClassLoader(),

Review comment:
       This could cause issues in the future and should be avoided. The class loader should be configurable. At least it should come from the context.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1b54a2ef6c25c92bd92bb43ab76218c9aa42e849 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572) 
   * ec3a0972e352ea5439c09043cc0c02a91c063cc2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737470756



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratorCastRule.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Cast rule that has code generation capabilities.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CodeGeneratorCastRule<IN, OUT> extends CastRule<IN, OUT> {
+
+    /**
+     * Generates a code block composed by different statements performing the casting. The returned
+     * code block must have a variable containing the result and an isNull term.

Review comment:
       I've removed that sentence and just linked to `CastCodeBlock`, which explains the detail.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratorCastRule.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Cast rule that has code generation capabilities.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CodeGeneratorCastRule<IN, OUT> extends CastRule<IN, OUT> {
+
+    /**
+     * Generates a code block composed by different statements performing the casting. The returned
+     * code block must have a variable containing the result and an isNull term.

Review comment:
       I've removed that sentence and just linked to `CastCodeBlock`, which explains the details.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737499573



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractNullAwareCodeGeneratorCastRule.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Base class for cast rules supporting code generation. This class inherits from {@link
+ * AbstractCodeGeneratorCastRule} and takes care of nullability checks.
+ */
+@Internal
+public abstract class AbstractNullAwareCodeGeneratorCastRule<IN, OUT>
+        extends AbstractCodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractNullAwareCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    /**
+     * This method doesn't need to take care of null checks handling of input values.
+     * Implementations should write the cast result in the {@code returnVariable}.
+     */
+    protected abstract String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType);
+
+    @Override
+    public CastCodeBlock generateCodeBlock(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            LogicalType inputType,
+            LogicalType targetType) {
+        StringBuilder resultCode = new StringBuilder();
+
+        // Result of a casting can be null only and only if the input is null
+        boolean isResultNullable = inputType.isNullable();
+        String nullTerm;
+        if (isResultNullable) {
+            nullTerm = context.declareVariable("boolean", "isNull");
+            resultCode.append(nullTerm).append(" = ").append(inputTerm).append(" == null;\n");
+        } else {
+            nullTerm = "false";
+        }
+
+        // Create the result value variable
+        String returnTerm = context.declareVariable(targetType, "result");
+
+        // Generate the code block
+        String castCodeBlock =
+                this.generateCodeBlockInternal(
+                        context, inputTerm, returnTerm, inputType, targetType);
+
+        if (isResultNullable) {
+            resultCode
+                    .append("if (!")

Review comment:
       I don't understand what's your suggestion here, should we keep all `+` or `StringBuilder`? I personally just tried to use whatever fits best, but I'm ok if we wanna decide for trying to stick to a precise code style. 




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572) 
   * ec3a0972e352ea5439c09043cc0c02a91c063cc2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r733586413



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} using the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input data type and target data type. Returns
+     * {@code null} if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(
+            LogicalType inputDataType, LogicalType targetDataType) {
+        return INSTANCE.internalResolve(inputDataType, targetDataType);
+    }
+
+    /** @see #resolve(LogicalType, LogicalType) */
+    public static @Nullable CastRule<?, ?> resolve(
+            DataType inputDataType, DataType targetDataType) {
+        return resolve(inputDataType.getLogicalType(), targetDataType.getLogicalType());
+    }
+
+    /* ------ Implementation ------ */
+
+    private static final CastRuleProvider INSTANCE = new CastRuleProvider();
+
+    static {
+        INSTANCE.addRule(TimestampToStringCastRule$.MODULE$)
+                .addRule(IdentityCastRule$.MODULE$)
+                .addRule(UpcastToBigIntCastRule$.MODULE$)
+                .freeze();
+    }
+
+    // Map<Target family or root, Map<Input family or root, rule>>
+    private Map<Object, Map<Object, CastRule<?, ?>>> rules = new HashMap<>();
+    private List<CastRule<?, ?>> rulesWithCustomPredicate = new ArrayList<>();

Review comment:
       can be `final`

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} using the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input data type and target data type. Returns
+     * {@code null} if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(
+            LogicalType inputDataType, LogicalType targetDataType) {
+        return INSTANCE.internalResolve(inputDataType, targetDataType);
+    }
+
+    /** @see #resolve(LogicalType, LogicalType) */
+    public static @Nullable CastRule<?, ?> resolve(
+            DataType inputDataType, DataType targetDataType) {
+        return resolve(inputDataType.getLogicalType(), targetDataType.getLogicalType());
+    }
+
+    /* ------ Implementation ------ */
+
+    private static final CastRuleProvider INSTANCE = new CastRuleProvider();
+
+    static {
+        INSTANCE.addRule(TimestampToStringCastRule$.MODULE$)
+                .addRule(IdentityCastRule$.MODULE$)
+                .addRule(UpcastToBigIntCastRule$.MODULE$)
+                .freeze();
+    }
+
+    // Map<Target family or root, Map<Input family or root, rule>>
+    private Map<Object, Map<Object, CastRule<?, ?>>> rules = new HashMap<>();
+    private List<CastRule<?, ?>> rulesWithCustomPredicate = new ArrayList<>();
+
+    private CastRuleProvider addRule(CastRule<?, ?> rule) {
+        CastRulePredicate predicate = rule.getPredicateDefinition();
+
+        for (LogicalTypeRoot targetTypeRoot : predicate.getTargetTypes()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeRoot, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+        for (LogicalTypeFamily targetTypeFamily : predicate.getTargetTypeFamilies()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeFamily, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+
+        if (predicate.getCustomPredicate() != null) {
+            rulesWithCustomPredicate.add(rule);
+        }
+
+        return this;
+    }
+
+    private CastRule<?, ?> internalResolve(LogicalType inputDataType, LogicalType targetDataType) {

Review comment:
       nit: for `LogicalType` we should not use `inputDataType` as the name but `inputType`. This also makes the code shorter.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} using the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input data type and target data type. Returns
+     * {@code null} if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(
+            LogicalType inputDataType, LogicalType targetDataType) {
+        return INSTANCE.internalResolve(inputDataType, targetDataType);
+    }
+
+    /** @see #resolve(LogicalType, LogicalType) */
+    public static @Nullable CastRule<?, ?> resolve(
+            DataType inputDataType, DataType targetDataType) {
+        return resolve(inputDataType.getLogicalType(), targetDataType.getLogicalType());
+    }
+
+    /* ------ Implementation ------ */
+
+    private static final CastRuleProvider INSTANCE = new CastRuleProvider();
+
+    static {
+        INSTANCE.addRule(TimestampToStringCastRule$.MODULE$)
+                .addRule(IdentityCastRule$.MODULE$)
+                .addRule(UpcastToBigIntCastRule$.MODULE$)
+                .freeze();
+    }
+
+    // Map<Target family or root, Map<Input family or root, rule>>
+    private Map<Object, Map<Object, CastRule<?, ?>>> rules = new HashMap<>();
+    private List<CastRule<?, ?>> rulesWithCustomPredicate = new ArrayList<>();
+
+    private CastRuleProvider addRule(CastRule<?, ?> rule) {
+        CastRulePredicate predicate = rule.getPredicateDefinition();
+
+        for (LogicalTypeRoot targetTypeRoot : predicate.getTargetTypes()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeRoot, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+        for (LogicalTypeFamily targetTypeFamily : predicate.getTargetTypeFamilies()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeFamily, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+
+        if (predicate.getCustomPredicate() != null) {
+            rulesWithCustomPredicate.add(rule);
+        }
+
+        return this;
+    }
+
+    private CastRule<?, ?> internalResolve(LogicalType inputDataType, LogicalType targetDataType) {
+        // Try lookup by target type root/type families
+        Map<Object, CastRule<?, ?>> inputTypeToCastRuleMap =
+                lookupTypeInMap(rules, targetDataType.getTypeRoot());
+        CastRule<?, ?> rule;
+        if (inputTypeToCastRuleMap != null) {
+            // Try lookup by input type root/type families
+            rule = lookupTypeInMap(inputTypeToCastRuleMap, inputDataType.getTypeRoot());
+            if (rule != null) {
+                return rule;
+            }
+        }
+
+        // Try with the custom predicate rules
+        rule =
+                rulesWithCustomPredicate.stream()
+                        .filter(
+                                r ->
+                                        r.getPredicateDefinition()
+                                                .getCustomPredicate()
+                                                .test(inputDataType, targetDataType))
+                        .findFirst()
+                        .orElse(null);
+
+        return rule;
+    }
+
+    private void freeze() {

Review comment:
       why not simply using a `static {}` right after the map member and call some `add` methods. we also don't need the `freeze` because the maps are not exposed as far as I can see. My main goal here is code simplification.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} using the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input data type and target data type. Returns
+     * {@code null} if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(
+            LogicalType inputDataType, LogicalType targetDataType) {
+        return INSTANCE.internalResolve(inputDataType, targetDataType);
+    }
+
+    /** @see #resolve(LogicalType, LogicalType) */
+    public static @Nullable CastRule<?, ?> resolve(
+            DataType inputDataType, DataType targetDataType) {
+        return resolve(inputDataType.getLogicalType(), targetDataType.getLogicalType());
+    }
+
+    /* ------ Implementation ------ */
+
+    private static final CastRuleProvider INSTANCE = new CastRuleProvider();
+
+    static {
+        INSTANCE.addRule(TimestampToStringCastRule$.MODULE$)
+                .addRule(IdentityCastRule$.MODULE$)
+                .addRule(UpcastToBigIntCastRule$.MODULE$)
+                .freeze();
+    }
+
+    // Map<Target family or root, Map<Input family or root, rule>>
+    private Map<Object, Map<Object, CastRule<?, ?>>> rules = new HashMap<>();

Review comment:
       can be `final`

##########
File path: flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/data/casting/rules/TimestampToStringCastRule.scala
##########
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting.rules
+
+import org.apache.flink.table.data.TimestampData
+import org.apache.flink.table.data.casting.{CastRulePredicate, CodeGeneratorCastRule}
+import org.apache.flink.table.planner.codegen.CodeGenUtils.{className, qualifyMethod}
+import org.apache.flink.table.planner.codegen.calls.BuiltInMethods.TIMESTAMP_TO_STRING_TIME_ZONE
+import org.apache.flink.table.runtime.functions.SqlDateTimeUtils
+import org.apache.flink.table.types.logical.{LocalZonedTimestampType, LogicalType, LogicalTypeFamily, LogicalTypeRoot, TimestampType}
+
+object TimestampToStringCastRule extends AbstractCharacterFamilyTargetRule[TimestampData](
+  CastRulePredicate.builder()
+    .input(LogicalTypeFamily.TIMESTAMP)
+    .target(LogicalTypeFamily.CHARACTER_STRING)
+    .build()
+) {
+  override def generateStringExpression(
+                                         context: CodeGeneratorCastRule.Context,
+                                         inputArgumentName: String,
+                                         inputLogicalType: LogicalType,
+                                         targetLogicalType: LogicalType): String = {
+    val zoneId = inputLogicalType.getTypeRoot match {
+      case LogicalTypeRoot.TIMESTAMP_WITH_LOCAL_TIME_ZONE => context.getSessionTimeZoneTerm
+      case _ => s"${className[SqlDateTimeUtils]}.UTC_ZONE"
+    }
+    val precision = inputLogicalType match {

Review comment:
       use `LogicalTypeChecks.getPrecision()` 

##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/data/casting/CastRulesTest.java
##########
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.table.data.StringData;
+import org.apache.flink.table.data.TimestampData;
+import org.apache.flink.table.types.DataType;
+
+import org.junit.jupiter.api.DynamicTest;
+import org.junit.jupiter.api.TestFactory;
+
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.apache.flink.table.api.DataTypes.BIGINT;
+import static org.apache.flink.table.api.DataTypes.INT;
+import static org.apache.flink.table.api.DataTypes.SMALLINT;
+import static org.apache.flink.table.api.DataTypes.STRING;
+import static org.apache.flink.table.api.DataTypes.TIMESTAMP;
+import static org.apache.flink.table.api.DataTypes.TIMESTAMP_LTZ;
+import static org.apache.flink.table.api.DataTypes.TINYINT;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * This class runs unit tests of {@link org.apache.flink.table.data.casting.CastRule}

Review comment:
       nit: import classes in JavaDocs to improve the reading flow

##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastRule.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.time.ZoneId;
+
+/**
+ * Casting executor factory performs the pre-flight of a casting operation.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CastRule<IN, OUT> {
+
+    /** @see CastRulePredicate for more details about a cast rule predicate definition */
+    CastRulePredicate getPredicateDefinition();
+
+    /**
+     * Create a casting executor starting from the provided input type. The returned {@link
+     * CastExecutor} assumes the input value is using the internal data type, and it's a valid value
+     * for the provided {@code targetLogicalType}.
+     */
+    CastExecutor<IN, OUT> create(

Review comment:
       why do both `CastRuleProvider` and `CastRule` take source and target type? isn't this redundant? the `CastRuleProvider` can directly return the `CastExecutor` and we would save an additional indirection. We could convert the `CastRuleProvider` into a `CastExecutorProvider` that would only work with `CastRule`s internally.

##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastRule.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.time.ZoneId;
+
+/**
+ * Casting executor factory performs the pre-flight of a casting operation.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CastRule<IN, OUT> {

Review comment:
       `CastExecutor` could be in the `data.utils` package then

##########
File path: flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/data/casting/rules/AbstractCharacterFamilyTargetRule.scala
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting.rules
+
+import org.apache.flink.table.data.StringData
+import org.apache.flink.table.data.binary.BinaryStringData
+import org.apache.flink.table.data.casting.{CastExpression, CastRulePredicate, CodeGeneratorCastRule}
+import org.apache.flink.table.planner.codegen.CodeGenUtils.className
+import org.apache.flink.table.types.logical.{CharType, LogicalType, VarCharType}
+
+abstract class AbstractCharacterFamilyTargetRule[IN](predicate: CastRulePredicate)
+  extends AbstractCodeGeneratorCastRule[IN, StringData](predicate) {
+
+  def generateStringExpression(context: CodeGeneratorCastRule.Context,

Review comment:
       please follow this style for indention:
   https://github.com/databricks/scala-style-guide#indent
   
   we can discuss to introduce a strict code style in the future

##########
File path: flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/data/casting/rules/AbstractCastRule.scala
##########
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting.rules
+
+import org.apache.flink.table.data.casting.{CastRule, CastRulePredicate}
+
+abstract class AbstractCastRule[IN, OUT](predicate: CastRulePredicate) extends CastRule[IN, OUT] {

Review comment:
       let's try to implement most rules in Java. so far the rules are not overly complicated. we can still fallback in Scala if very important utilities cannot be migrated

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CodeGeneratedCastExecutor.java
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.api.common.InvalidProgramException;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import org.codehaus.commons.compiler.CompileException;
+import org.codehaus.janino.ExpressionEvaluator;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Cast executor which can be instantiated starting from an expression code.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+class CodeGeneratedCastExecutor<IN, OUT> implements CastExecutor<IN, OUT> {
+
+    private final ExpressionEvaluator ee;
+
+    // To reuse for invocations
+    private final Object[] inputArray;
+
+    CodeGeneratedCastExecutor(
+            String code, String inputArgumentName, Class<IN> inputClass, Class<OUT> outputClass) {
+        this.ee = new ExpressionEvaluator();
+        // Input args
+        ee.setParameters(new String[] {inputArgumentName}, new Class[] {inputClass});
+        // Result type
+        ee.setExpressionType(outputClass);
+        try {
+            // Compile
+            ee.cook(code);

Review comment:
       compilation can be quite expensive and take a lot of time. usually we use our compiler utils to speed things up, and cache reoccuring code. maybe we should do the same here

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CodeGeneratedCastExecutor.java
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.api.common.InvalidProgramException;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import org.codehaus.commons.compiler.CompileException;
+import org.codehaus.janino.ExpressionEvaluator;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Cast executor which can be instantiated starting from an expression code.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+class CodeGeneratedCastExecutor<IN, OUT> implements CastExecutor<IN, OUT> {
+
+    private final ExpressionEvaluator ee;

Review comment:
       for code readbility, don't use abbreviations like `ee` but rather just `evaluator`

##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastRule.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.time.ZoneId;
+
+/**
+ * Casting executor factory performs the pre-flight of a casting operation.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CastRule<IN, OUT> {

Review comment:
       if we need to call code generator for `PrintUtils` anyway that sits in the planner, we can also move this interface to the planner. only the `CastExecutor` would stay in common.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} using the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input data type and target data type. Returns
+     * {@code null} if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(
+            LogicalType inputDataType, LogicalType targetDataType) {
+        return INSTANCE.internalResolve(inputDataType, targetDataType);
+    }
+
+    /** @see #resolve(LogicalType, LogicalType) */
+    public static @Nullable CastRule<?, ?> resolve(
+            DataType inputDataType, DataType targetDataType) {
+        return resolve(inputDataType.getLogicalType(), targetDataType.getLogicalType());
+    }
+
+    /* ------ Implementation ------ */
+
+    private static final CastRuleProvider INSTANCE = new CastRuleProvider();
+
+    static {
+        INSTANCE.addRule(TimestampToStringCastRule$.MODULE$)
+                .addRule(IdentityCastRule$.MODULE$)
+                .addRule(UpcastToBigIntCastRule$.MODULE$)
+                .freeze();
+    }
+
+    // Map<Target family or root, Map<Input family or root, rule>>
+    private Map<Object, Map<Object, CastRule<?, ?>>> rules = new HashMap<>();
+    private List<CastRule<?, ?>> rulesWithCustomPredicate = new ArrayList<>();
+
+    private CastRuleProvider addRule(CastRule<?, ?> rule) {
+        CastRulePredicate predicate = rule.getPredicateDefinition();
+
+        for (LogicalTypeRoot targetTypeRoot : predicate.getTargetTypes()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeRoot, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+        for (LogicalTypeFamily targetTypeFamily : predicate.getTargetTypeFamilies()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeFamily, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+
+        if (predicate.getCustomPredicate() != null) {
+            rulesWithCustomPredicate.add(rule);
+        }
+
+        return this;
+    }
+
+    private CastRule<?, ?> internalResolve(LogicalType inputDataType, LogicalType targetDataType) {
+        // Try lookup by target type root/type families
+        Map<Object, CastRule<?, ?>> inputTypeToCastRuleMap =

Review comment:
       nit: I would really encourage to use `final` also for local variable. It makes it clearer when the content of a variable is changed again or not. e.g. `rule` is reassigned whereas `inputTypeToCastRuleMap` is not. 




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-948652702


   Logically they might belong together but only `CastExecutor` is really necessary in common. We should try to keep this module slim. And the concept of `CastRule` and `CastRulePredicate` is a planner concept. In theory, one can fuse `CastRule` and `CastExecutor` into one concept (at least from the outside).


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310) 
   * 43974816c1bd08cbdb58535913853fa115fcaebd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   * 1740f472b8e16bf6759756822d177b60f3b0c42c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-953959485


   @flinkbot run azure


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "953874367",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "953959485",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * ec3a0972e352ea5439c09043cc0c02a91c063cc2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr closed pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr closed pull request #17522:
URL: https://github.com/apache/flink/pull/17522


   


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737447015



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/utils/CastExecutor.java
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.utils;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.api.TableException;
+
+import javax.annotation.Nullable;
+
+/**
+ * Interface to model a function that performs the casting of a value from one type to another.
+ *
+ * <p>This interface is serializable in order to be embedded in the runtime codegen.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+@FunctionalInterface
+public interface CastExecutor<IN, OUT> {
+    /**
+     * Cast the input value. The output is null only and only if the input is null. The method

Review comment:
       I don't think we should, because `TRY_CAST` is the user interface. This interface is just a detailed explanation of how internally we need to implement the casting logic, and every new implementation should be compliant to such interface (that is, when porting to these new interfaces, we need to take care of this difference)




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r732007179



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} starting from the input and the target type. */

Review comment:
       I think that's an implementation detail of this class, what matters to the user is that I give him a rule that matches the input and target types. I prefer to keep it this way since it's more descriptive IMHO 




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d16cc0f9e2290406d788453db9f771fe6cbc8637 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946698806


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit def050276334d930dec36d5cffe52a47c1bf039d (Tue Oct 19 13:00:49 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r732842077



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} starting from the input and the target type. */

Review comment:
       How about now?




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   * 1740f472b8e16bf6759756822d177b60f3b0c42c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737473792



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratorCastRule.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Cast rule that has code generation capabilities.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CodeGeneratorCastRule<IN, OUT> extends CastRule<IN, OUT> {
+
+    /**
+     * Generates a code block composed by different statements performing the casting. The returned
+     * code block must have a variable containing the result and an isNull term.
+     */
+    CastCodeBlock generateCodeBlock(
+            Context context,
+            String inputTerm,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType);
+
+    /** Context for code generation. */
+    interface Context {
+        /** @return the session time zone term */
+        String getSessionTimeZoneTerm();
+
+        /**
+         * Declare a new variable in the global scope.
+         *
+         * @return the variable name
+         */
+        String declareVariable(String type, String variablePrefix);

Review comment:
       `global` scope was a bad naming, I changed the comment, can you check it?




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737726852



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastRule.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.time.ZoneId;
+
+/**
+ * Casting executor factory performs the pre-flight of a casting operation.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CastRule<IN, OUT> {
+
+    /** @see CastRulePredicate for more details about a cast rule predicate definition */
+    CastRulePredicate getPredicateDefinition();
+
+    /**
+     * Create a casting executor starting from the provided input type. The returned {@link
+     * CastExecutor} assumes the input value is using the internal data type, and it's a valid value
+     * for the provided {@code targetLogicalType}.
+     */
+    CastExecutor<IN, OUT> create(

Review comment:
       This one should now be addressed, reopen if you need it




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r734329500



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratedCastExecutor.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import org.codehaus.janino.ExpressionEvaluator;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Cast executor which can be instantiated starting from an expression code.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+class CodeGeneratedCastExecutor<IN, OUT> implements CastExecutor<IN, OUT> {

Review comment:
       Either we remove this declaration or we fix the implementation. Take a look at how `DataStructureConverter` achieves this. We have tests in `DataStructureConverterTest` to simulate the serialization. But I don't think that `PrintUtils` need to be serializable.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr commented on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr commented on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-948652702


   Logically they might belong together but only `CastExecutor` is really necessary in common. We should try to keep this module slim. And the concept of `CastRule` and `CastRulePredicate` is a planner concept. In theory, one can fuse `CastRule` and `CastExecutor` into one concept.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r733701740



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastRule.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.time.ZoneId;
+
+/**
+ * Casting executor factory performs the pre-flight of a casting operation.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CastRule<IN, OUT> {
+
+    /** @see CastRulePredicate for more details about a cast rule predicate definition */
+    CastRulePredicate getPredicateDefinition();
+
+    /**
+     * Create a casting executor starting from the provided input type. The returned {@link
+     * CastExecutor} assumes the input value is using the internal data type, and it's a valid value
+     * for the provided {@code targetLogicalType}.
+     */
+    CastExecutor<IN, OUT> create(

Review comment:
       `CastRuleProvider` rule resolver tries to use first `LogicalTypeRoot` for matching, then `LogicalTypeFamily` and then, if nothing matches, it uses as last resort to match predicates on the instances of `LogicalType` itself.
   `CastRule` needs the instances of `LogicalType` because either the code generated expression and the `CastExecutor` depends on parameters inside `LogicalType` (e.g. timestamp precision).
   
   > isn't this redundant? the CastRuleProvider can directly return the CastExecutor and we would save an additional indirection. We could convert the CastRuleProvider into a CastExecutorProvider that would only work with CastRules internally.
   
   Not really, because if you look into the `ScalarOperatorGens` changes you see how depending on which interface the `CastRule` implements, I decide how to generate code https://github.com/apache/flink/pull/17522/commits/68acfefe511801125154e10cf53a05c5f2a83fd8#diff-7f639dba805e67cebeeb8b3cba3625477c82929ffc74980dede1209ce1692155R922.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-948625872


   > If this is the case we can also move most of the code out of flink-table-common and only keep the CastExecutor and the interface of CastExecutorProvider there.
   
   Yep, as you see this PR adds in table common only `CastExecutor`, `CastRule` and `CastRulePredicate`. Perhaps we can just keep `CastExecutor` in common, but I prefer to keep all three of them as I think they logically belong together. 


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r738193839



##########
File path: flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/expressions/TemporalTypesTest.scala
##########
@@ -470,196 +470,196 @@ class TemporalTypesTest extends ExpressionTestBase {
 
   @Test
   def testTimeIntervalArithmetic(): Unit = {
-
-    // interval months comparison
-
-    testAllApis(
-      12.months < 24.months,
-      "INTERVAL '12' MONTH < INTERVAL '24' MONTH",
-      "true")
-
-    testAllApis(
-      8.years === 8.years,
-      "INTERVAL '8' YEAR = INTERVAL '8' YEAR",
-      "true")
-
-    // interval millis comparison
-
-    testAllApis(
-      8.millis > 10.millis,
-      "INTERVAL '0.008' SECOND > INTERVAL '0.010' SECOND",
-      "false")
-
-    testAllApis(
-      8.millis === 8.millis,
-      "INTERVAL '0.008' SECOND = INTERVAL '0.008' SECOND",
-      "true")
-
-    // interval months addition/subtraction
-
-    testAllApis(
-      8.years + 10.months,
-      "INTERVAL '8' YEAR + INTERVAL '10' MONTH",
-      "+8-10")
-
-    testAllApis(
-      2.years - 12.months,
-      "INTERVAL '2' YEAR - INTERVAL '12' MONTH",
-      "+1-00")
-
-    testAllApis(
-      -2.years,
-      "-INTERVAL '2' YEAR",
-      "-2-00")
-
-    // interval millis addition/subtraction
-
-    testAllApis(
-      8.hours + 10.minutes + 12.seconds + 5.millis,
-      "INTERVAL '8' HOUR + INTERVAL '10' MINUTE + INTERVAL '12.005' SECOND",
-      "+0 08:10:12.005")
-
-    testAllApis(
-      1.minute - 10.seconds,
-      "INTERVAL '1' MINUTE - INTERVAL '10' SECOND",
-      "+0 00:00:50.000")
-
-    testAllApis(
-      -10.seconds,
-      "-INTERVAL '10' SECOND",
-      "-0 00:00:10.000")
-
-    // addition to date
-
-    // interval millis
-    testAllApis(
-      'f0 + 2.days,
-      "f0 + INTERVAL '2' DAY",
-      "1990-10-16")
-
-    // interval millis
-    testAllApis(
-      30.days + 'f0,
-      "INTERVAL '30' DAY + f0",
-      "1990-11-13")
-
-    // interval months
-    testAllApis(
-      'f0 + 2.months,
-      "f0 + INTERVAL '2' MONTH",
-      "1990-12-14")
-
-    // interval months
-    testAllApis(
-      2.months + 'f0,
-      "INTERVAL '2' MONTH + f0",
-      "1990-12-14")
-
-    // addition to time
-
-    // interval millis
-    testAllApis(
-      'f1 + 12.hours,
-      "f1 + INTERVAL '12' HOUR",
-      "22:20:45")
-
-    // interval millis
-    testAllApis(
-      12.hours + 'f1,
-      "INTERVAL '12' HOUR + f1",
-      "22:20:45")
-
-    // addition to timestamp
-
-    // interval millis
-    testAllApis(
-      'f2 + 10.days + 4.millis,
-      "f2 + INTERVAL '10 00:00:00.004' DAY TO SECOND",
-      "1990-10-24 10:20:45.127")
-
-    // interval millis
-    testAllApis(
-      10.days + 'f2 + 4.millis,
-      "INTERVAL '10 00:00:00.004' DAY TO SECOND + f2",
-      "1990-10-24 10:20:45.127")
-
-    // interval months
-    testAllApis(
-      'f2 + 10.years,
-      "f2 + INTERVAL '10' YEAR",
-      "2000-10-14 10:20:45.123")
-
-    // interval months
-    testAllApis(
-      10.years + 'f2,
-      "INTERVAL '10' YEAR + f2",
-      "2000-10-14 10:20:45.123")
-
-    // subtraction from date
-
-    // interval millis
-    testAllApis(
-      'f0 - 2.days,
-      "f0 - INTERVAL '2' DAY",
-      "1990-10-12")
-
-    // interval millis
-    testAllApis(
-      -30.days + 'f0,
-      "INTERVAL '-30' DAY + f0",
-      "1990-09-14")
-
-    // interval months
-    testAllApis(
-      'f0 - 2.months,
-      "f0 - INTERVAL '2' MONTH",
-      "1990-08-14")
-
-    // interval months
-    testAllApis(
-      -2.months + 'f0,
-      "-INTERVAL '2' MONTH + f0",
-      "1990-08-14")
-
-    // subtraction from time
-
-    // interval millis
-    testAllApis(
-      'f1 - 12.hours,
-      "f1 - INTERVAL '12' HOUR",
-      "22:20:45")
-
-    // interval millis
-    testAllApis(
-      -12.hours + 'f1,
-      "INTERVAL '-12' HOUR + f1",
-      "22:20:45")
-
-    // subtraction from timestamp
-
-    // interval millis
-    testAllApis(
-      'f2 - 10.days - 4.millis,
-      "f2 - INTERVAL '10 00:00:00.004' DAY TO SECOND",
-      "1990-10-04 10:20:45.119")
-
-    // interval millis
-    testAllApis(
-      -10.days + 'f2 - 4.millis,
-      "INTERVAL '-10 00:00:00.004' DAY TO SECOND + f2",
-      "1990-10-04 10:20:45.119")
-
-    // interval months
-    testAllApis(
-      'f2 - 10.years,
-      "f2 - INTERVAL '10' YEAR",
-      "1980-10-14 10:20:45.123")
-
-    // interval months
-    testAllApis(
-      -10.years + 'f2,
-      "INTERVAL '-10' YEAR + f2",
-      "1980-10-14 10:20:45.123")
+//

Review comment:
       Sorry, that's a leftover




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737488635



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractCodeGeneratorCastRule.java
##########
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRule;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.generated.CompileUtils;
+import org.apache.flink.table.runtime.typeutils.InternalSerializers;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.AbstractMap.SimpleImmutableEntry;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * Base class for {@link CastRule} supporting code generation. This base class implements {@link
+ * #create(CastRule.Context, LogicalType, LogicalType)} compiling the generated code block into a
+ * {@link CastExecutor} implementation.
+ *
+ * <p>We suggest implementing {@link CodeGeneratorCastRule} starting from {@link
+ * AbstractNullAwareCodeGeneratorCastRule}, which provides nullability checks, or from {@link
+ * AbstractExpressionCodeGeneratorCastRule} to generate simple expression casts.
+ */
+public abstract class AbstractCodeGeneratorCastRule<IN, OUT> extends AbstractCastRule<IN, OUT>
+        implements CodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CastExecutor<IN, OUT> create(
+            CastRule.Context castRuleContext,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        final String inputTerm = "_myInput";
+        final String className = CodeGenUtils.newName("GeneratedCastExecutor");
+        final String inputTypeTerm = CodeGenUtils.boxedTypeTermForType(inputLogicalType);
+        final String targetTypeTerm = CodeGenUtils.boxedTypeTermForType(targetLogicalType);
+
+        final CastExecutorCodeGeneratorContext ctx =
+                new CastExecutorCodeGeneratorContext(castRuleContext);
+        final CastCodeBlock codeBlock =
+                generateCodeBlock(ctx, inputTerm, inputLogicalType, targetLogicalType);
+
+        // Class fields can contain type serializers
+        final String classFieldDecls =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "private final TypeSerializer " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        final String constructorSignature =
+                "public "
+                        + className
+                        + "("
+                        + ctx.getDeclaredTypeSerializers().stream()
+                                .map(name -> "TypeSerializer " + name)
+                                .collect(Collectors.joining(", "))
+                        + ")";
+        final String constructorBody =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "this." + name + " = " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        // Because janino doesn't support generics, we need to manually cast the input variable of
+        // the cast method
+        final String functionSignature =
+                "@Override public Object cast(Object _myInputObj) throws "
+                        + CodeGenUtils.className(TableException.class);
+        final String inputVarDecl =
+                inputTypeTerm + " " + inputTerm + " = (" + inputTypeTerm + ") _myInputObj;\n";
+
+        final String returnStmt = "return " + codeBlock.getReturnTerm() + ";\n";
+
+        final String classCode =
+                "public final class "
+                        + className
+                        + " implements "
+                        + CodeGenUtils.className(CastExecutor.class)
+                        + " {\n"
+                        + classFieldDecls
+                        + constructorSignature
+                        + " {\n"
+                        + constructorBody
+                        + "}\n"
+                        + functionSignature
+                        + "{\n"
+                        + inputVarDecl
+                        + String.join("\n", ctx.variableDeclarationStatements)
+                        + codeBlock.getCode()
+                        + "\n"
+                        + returnStmt
+                        + "}\n}";
+
+        try {
+            Object[] constructorArgs =
+                    ctx.getTypeSerializersInstances().toArray(new TypeSerializer[0]);
+            return (CastExecutor<IN, OUT>)
+                    CompileUtils.compile(
+                                    Thread.currentThread().getContextClassLoader(),

Review comment:
       I've added it to the context, but i'm not sure in the codegen where to get the user classloader from. Shouldn't it be in `TableConfig`?




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r732007560



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastExpression.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.util.Objects;
+
+/** Generated cast expression result. */

Review comment:
       Added some details.

##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastRulePredicate.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.function.BiPredicate;
+
+/**
+ * In order to apply a {@link CastRule}, the runtime checks if a particular rule matches the tuple
+ * of input and target type using this class. In particular, a rule is applied if:
+ *
+ * <ol>
+ *   <li>{@link #getTargetTypes()} includes the {@link LogicalTypeRoot} of target type and either
+ *       <ol>
+ *         <li>{@link #getInputTypes()} includes the {@link LogicalTypeRoot} of input type or
+ *         <li>{@link #getInputTypeFamilies()} includes one of the {@link LogicalTypeFamily} of
+ *             input type
+ *       </ol>
+ *   <li>Or {@link #getTargetTypeFamilies()} includes one of the {@link LogicalTypeFamily} of target
+ *       type and either
+ *       <ol>
+ *         <li>{@link #getInputTypes()} includes the {@link LogicalTypeRoot} of input type or
+ *         <li>{@link #getInputTypeFamilies()} includes one of the {@link LogicalTypeFamily} of
+ *             input type
+ *       </ol>
+ *   <li>Or, if {@link #getCustomPredicate()} is not null, the input type and target type matches

Review comment:
       I tried to clarify it a bit, check it out now




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266) 
   * 2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] matriv commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
matriv commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r732876782



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} starting from the input and the target type. */

Review comment:
       Thx!!




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d16cc0f9e2290406d788453db9f771fe6cbc8637 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283) 
   * ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266) 
   * 2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   * 1740f472b8e16bf6759756822d177b60f3b0c42c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737492440



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && target.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && isValidArrayCasting(
+                                                        ((ArrayType) input).getElementType(),
+                                                        ((ArrayType) target).getElementType()))
+                        .build());
+    }
+
+    private static boolean isValidArrayCasting(
+            LogicalType innerInputType, LogicalType innerTargetType) {
+        return CastRuleProvider.resolve(innerInputType, innerTargetType) != null;

Review comment:
       > This assumes that only casts that have been ported to the new cast rule structure are support yet, right? No, ARRAY<INT> to ARRAY<DECIMAL<20, 10>?
   
   Exactly, this rule will work only with new cast rules (which is one of the reasons why this comment https://github.com/apache/flink/pull/17522#discussion_r737454676) 




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] matriv commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
matriv commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r738215109



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractCodeGeneratorCastRule.java
##########
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRule;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.generated.CompileUtils;
+import org.apache.flink.table.runtime.typeutils.InternalSerializers;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.AbstractMap.SimpleImmutableEntry;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * Base class for {@link CastRule} supporting code generation. This base class implements {@link
+ * #create(CastRule.Context, LogicalType, LogicalType)} compiling the generated code block into a
+ * {@link CastExecutor} implementation.
+ *
+ * <p>We suggest implementing {@link CodeGeneratorCastRule} starting from {@link
+ * AbstractNullAwareCodeGeneratorCastRule}, which provides nullability checks, or from {@link
+ * AbstractExpressionCodeGeneratorCastRule} to generate simple expression casts.
+ */
+public abstract class AbstractCodeGeneratorCastRule<IN, OUT> extends AbstractCastRule<IN, OUT>
+        implements CodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CastExecutor<IN, OUT> create(
+            CastRule.Context castRuleContext,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        final String inputTerm = "_myInput";
+        final String className = CodeGenUtils.newName("GeneratedCastExecutor");
+        final String inputTypeTerm = CodeGenUtils.boxedTypeTermForType(inputLogicalType);
+        final String targetTypeTerm = CodeGenUtils.boxedTypeTermForType(targetLogicalType);
+
+        final CastExecutorCodeGeneratorContext ctx =
+                new CastExecutorCodeGeneratorContext(castRuleContext);
+        final CastCodeBlock codeBlock =
+                generateCodeBlock(ctx, inputTerm, inputLogicalType, targetLogicalType);
+
+        // Class fields can contain type serializers
+        final String classFieldDecls =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "private final TypeSerializer " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        final String constructorSignature =
+                "public "
+                        + className
+                        + "("
+                        + ctx.getDeclaredTypeSerializers().stream()
+                                .map(name -> "TypeSerializer " + name)
+                                .collect(Collectors.joining(", "))
+                        + ")";
+        final String constructorBody =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "this." + name + " = " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        // Because janino doesn't support generics, we need to manually cast the input variable of
+        // the cast method
+        final String functionSignature =
+                "@Override public Object cast(Object _myInputObj) throws "
+                        + CodeGenUtils.className(TableException.class);
+        final String inputVarDecl =
+                inputTypeTerm + " " + inputTerm + " = (" + inputTypeTerm + ") _myInputObj;\n";
+
+        final String returnStmt = "return " + codeBlock.getReturnTerm() + ";\n";
+
+        final String classCode =

Review comment:
       I have tried with the `<toggleOffOn />` config option for the maven plugin config and then `// spotless:off/on` to mark the block of code, but doesn't seem to be respected, and I've read online that there are issues with spotless and `java-google-format` regarding this functionality.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737456090



##########
File path: flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/generated/GeneratedClass.java
##########
@@ -71,7 +71,7 @@ public T newInstance(ClassLoader classLoader) {
                     // Because Constructor.newInstance(Object... initargs), we need to load
                     // references into a new Object[], otherwise it cannot be compiled.
                     .newInstance(new Object[] {references});
-        } catch (Exception e) {
+        } catch (Throwable e) {

Review comment:
       Because `newInstance` can throw a [`LinkageError`](https://docs.oracle.com/javase/7/docs/api/java/lang/LinkageError.html), which is not subclass of `Throwable`




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-953874367


   @flinkbot run azure


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737512227



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && target.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && isValidArrayCasting(
+                                                        ((ArrayType) input).getElementType(),
+                                                        ((ArrayType) target).getElementType()))
+                        .build());
+    }
+
+    private static boolean isValidArrayCasting(
+            LogicalType innerInputType, LogicalType innerTargetType) {
+        return CastRuleProvider.resolve(innerInputType, innerTargetType) != null;
+    }
+
+    @SuppressWarnings("rawtypes")
+    @Override
+    protected String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        LogicalType innerInputType = ((ArrayType) inputLogicalType).getElementType();
+        LogicalType innerTargetType = ((ArrayType) targetLogicalType).getElementType();
+
+        String innerTargetTypeTerm = arrayElementType(innerTargetType);
+        String arraySize = inputTerm + ".size()";
+        String objArrayTerm = newName("objArray");
+
+        CodeGeneratorCastRule<?, ?> innerCastRule =
+                (CodeGeneratorCastRule) CastRuleProvider.resolve(innerInputType, innerTargetType);
+
+        StringBuilder result = new StringBuilder();
+        result.append(
+                innerTargetTypeTerm
+                        + "[] "
+                        + objArrayTerm
+                        + " = new "
+                        + innerTargetTypeTerm
+                        + "["
+                        + arraySize
+                        + "];\n");
+
+        result.append("for (int i = 0; i < " + arraySize + "; i++) {\n");
+        CastCodeBlock codeBlock =
+                innerCastRule.generateCodeBlock(
+                        context,
+                        inputTerm + "." + getArrayElement(innerInputType, "i"),
+                        innerInputType.copy(false), // Null check is done at the array access level
+                        innerTargetType);
+
+        String innerElementCode =
+                codeBlock.getCode()
+                        + "\n"
+                        + objArrayTerm
+                        + "[i] = "
+                        + codeBlock.getReturnTerm()
+                        + ";\n";
+
+        // Add null check if inner type is nullable
+        if (innerInputType.isNullable()) {
+            result.append("if (" + inputTerm + ".isNullAt(i)) {\n")
+                    .append(objArrayTerm + "[i] = null;\n")
+                    .append("} else {\n")
+                    .append(innerElementCode)
+                    .append("}\n");
+        } else {
+            result.append(innerElementCode);
+        }
+
+        result.append("}\n");
+
+        result.append(
+                returnVariable
+                        + " = new "
+                        + className(GenericArrayData.class)
+                        + "("
+                        + objArrayTerm
+                        + ");\n");
+
+        return result.toString();
+    }
+
+    private static String arrayElementType(LogicalType t) {
+        if (t.isNullable()) {
+            return "Object";
+        }
+        switch (t.getTypeRoot()) {
+            case BOOLEAN:
+                return "boolean";
+            case TINYINT:
+                return "byte";
+            case SMALLINT:
+                return "short";
+            case INTEGER:
+            case DATE:
+            case TIME_WITHOUT_TIME_ZONE:
+            case INTERVAL_YEAR_MONTH:
+                return "int";
+            case BIGINT:
+            case INTERVAL_DAY_TIME:
+                return "long";
+            case FLOAT:
+                return "float";
+            case DOUBLE:
+                return "double";
+            case DISTINCT_TYPE:
+                return arrayElementType(((DistinctType) t).getSourceType());
+        }
+        return "Object";
+    }
+
+    private static String getArrayElement(LogicalType elementType, String indexVar) {

Review comment:
       Perhaps you're referring to `CodeGenUtils.rowFieldReadAccess`, which works pretty much the same as this method. I added a separate commit with this change.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737512227



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && target.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && isValidArrayCasting(
+                                                        ((ArrayType) input).getElementType(),
+                                                        ((ArrayType) target).getElementType()))
+                        .build());
+    }
+
+    private static boolean isValidArrayCasting(
+            LogicalType innerInputType, LogicalType innerTargetType) {
+        return CastRuleProvider.resolve(innerInputType, innerTargetType) != null;
+    }
+
+    @SuppressWarnings("rawtypes")
+    @Override
+    protected String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        LogicalType innerInputType = ((ArrayType) inputLogicalType).getElementType();
+        LogicalType innerTargetType = ((ArrayType) targetLogicalType).getElementType();
+
+        String innerTargetTypeTerm = arrayElementType(innerTargetType);
+        String arraySize = inputTerm + ".size()";
+        String objArrayTerm = newName("objArray");
+
+        CodeGeneratorCastRule<?, ?> innerCastRule =
+                (CodeGeneratorCastRule) CastRuleProvider.resolve(innerInputType, innerTargetType);
+
+        StringBuilder result = new StringBuilder();
+        result.append(
+                innerTargetTypeTerm
+                        + "[] "
+                        + objArrayTerm
+                        + " = new "
+                        + innerTargetTypeTerm
+                        + "["
+                        + arraySize
+                        + "];\n");
+
+        result.append("for (int i = 0; i < " + arraySize + "; i++) {\n");
+        CastCodeBlock codeBlock =
+                innerCastRule.generateCodeBlock(
+                        context,
+                        inputTerm + "." + getArrayElement(innerInputType, "i"),
+                        innerInputType.copy(false), // Null check is done at the array access level
+                        innerTargetType);
+
+        String innerElementCode =
+                codeBlock.getCode()
+                        + "\n"
+                        + objArrayTerm
+                        + "[i] = "
+                        + codeBlock.getReturnTerm()
+                        + ";\n";
+
+        // Add null check if inner type is nullable
+        if (innerInputType.isNullable()) {
+            result.append("if (" + inputTerm + ".isNullAt(i)) {\n")
+                    .append(objArrayTerm + "[i] = null;\n")
+                    .append("} else {\n")
+                    .append(innerElementCode)
+                    .append("}\n");
+        } else {
+            result.append(innerElementCode);
+        }
+
+        result.append("}\n");
+
+        result.append(
+                returnVariable
+                        + " = new "
+                        + className(GenericArrayData.class)
+                        + "("
+                        + objArrayTerm
+                        + ");\n");
+
+        return result.toString();
+    }
+
+    private static String arrayElementType(LogicalType t) {
+        if (t.isNullable()) {
+            return "Object";
+        }
+        switch (t.getTypeRoot()) {
+            case BOOLEAN:
+                return "boolean";
+            case TINYINT:
+                return "byte";
+            case SMALLINT:
+                return "short";
+            case INTEGER:
+            case DATE:
+            case TIME_WITHOUT_TIME_ZONE:
+            case INTERVAL_YEAR_MONTH:
+                return "int";
+            case BIGINT:
+            case INTERVAL_DAY_TIME:
+                return "long";
+            case FLOAT:
+                return "float";
+            case DOUBLE:
+                return "double";
+            case DISTINCT_TYPE:
+                return arrayElementType(((DistinctType) t).getSourceType());
+        }
+        return "Object";
+    }
+
+    private static String getArrayElement(LogicalType elementType, String indexVar) {

Review comment:
       Perhaps you're referring to `CodeGenUtils.rowFieldReadAccess`, which works pretty much the same as this method. I see it's used for accessing to an `ArrayData` in `JsonGenerateUtils.generateMapConverter` as well. I added a separate commit with this change.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] matriv commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
matriv commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r731901591



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} starting from the input and the target type. */

Review comment:
       Shouldn't it be `starting from the target type and then the input type` ?

##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/data/casting/CastRulesTest.java
##########
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.table.data.StringData;
+import org.apache.flink.table.data.TimestampData;
+import org.apache.flink.table.types.DataType;
+
+import org.junit.jupiter.api.DynamicTest;
+import org.junit.jupiter.api.TestFactory;
+
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.apache.flink.table.api.DataTypes.BIGINT;
+import static org.apache.flink.table.api.DataTypes.INT;
+import static org.apache.flink.table.api.DataTypes.SMALLINT;
+import static org.apache.flink.table.api.DataTypes.STRING;
+import static org.apache.flink.table.api.DataTypes.TIMESTAMP;
+import static org.apache.flink.table.api.DataTypes.TIMESTAMP_LTZ;
+import static org.apache.flink.table.api.DataTypes.TINYINT;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+class CastRulesTest {

Review comment:
       Why not `public`?

##########
File path: flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala
##########
@@ -916,446 +915,481 @@ object ScalarOperatorGens {
       ctx: CodeGeneratorContext,
       operand: GeneratedExpression,
       targetType: LogicalType)
-    : GeneratedExpression = (operand.resultType.getTypeRoot, targetType.getTypeRoot) match {
+    : GeneratedExpression = {
+    // Try to use the new cast rules
+    val rule = CastRuleProvider.resolve(operand.resultType, targetType)
+    rule match {
+      case codeGeneratorCastRule: CodeGeneratorCastRule[_, _] =>
+        val castContext = new CodeGeneratorCastRule.Context {
+          override def getSessionTimeZoneTerm: String = ctx.addReusableSessionTimeZone()
+        }
+        val castExpression = codeGeneratorCastRule.generate(
+          castContext, operand.resultTerm, operand.resultType, targetType
+        )
+        return generateUnaryOperatorIfNotNull(ctx, castExpression.getReturnType, operand) {
+          _ => s"${castExpression.getCode}"
+        }
+      case _ => if (rule != null) {

Review comment:
       I would remove this code and maybe put it in a gist, and link it to the PR and the jira issue in case it becomes useful in the future.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} starting from the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input data type and target data type. Returns
+     * {@code null} if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(
+            LogicalType inputDataType, LogicalType targetDataType) {
+        return INSTANCE.internalResolve(inputDataType, targetDataType);
+    }
+
+    /** @see #resolve(LogicalType, LogicalType) */
+    public static @Nullable CastRule<?, ?> resolve(
+            DataType inputDataType, DataType targetDataType) {
+        return resolve(inputDataType.getLogicalType(), targetDataType.getLogicalType());
+    }
+
+    /* ------ Implementation ------ */
+
+    private static final CastRuleProvider INSTANCE = new CastRuleProvider();
+
+    static {
+        INSTANCE.addRule(TimestampToStringCastRule$.MODULE$)
+                .addRule(IdentityCastRule$.MODULE$)
+                .addRule(UpcastToBigIntCastRule$.MODULE$)
+                .freeze();
+    }
+
+    // Map<Target family or root, Map<Input family or root, rule>>
+    private Map<Object, Map<Object, CastRule<?, ?>>> rules = new HashMap<>();
+    private List<CastRule<?, ?>> rulesWithCustomPredicate = new ArrayList<>();
+
+    private CastRuleProvider addRule(CastRule<?, ?> rule) {
+        CastRulePredicate predicate = rule.getPredicateDefinition();
+
+        for (LogicalTypeRoot targetTypeRoot : predicate.getTargetTypes()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeRoot, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+        for (LogicalTypeFamily targetTypeFamily : predicate.getTargetTypeFamilies()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeFamily, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+
+        if (predicate.getCustomPredicate() != null) {
+            rulesWithCustomPredicate.add(rule);
+        }
+
+        return this;
+    }
+
+    private CastRule<?, ?> internalResolve(LogicalType inputDataType, LogicalType targetDataType) {
+        // Lookup by target type
+        Map<Object, CastRule<?, ?>> inputTypeToCastRuleMap =
+                lookupTypeInMap(rules, targetDataType.getTypeRoot());
+
+        // If nothing found, just return null
+        if (inputTypeToCastRuleMap == null) {
+            return null;
+        }
+
+        CastRule<?, ?> rule = lookupTypeInMap(inputTypeToCastRuleMap, inputDataType.getTypeRoot());
+        if (rule == null) {
+            // Try with the rules using custom predicates
+            rule =
+                    rulesWithCustomPredicate.stream()
+                            .filter(
+                                    r ->
+                                            r.getPredicateDefinition()
+                                                    .getCustomPredicate()
+                                                    .test(inputDataType, targetDataType))
+                            .findFirst()
+                            .orElse(null);
+        }
+
+        return rule;
+    }
+
+    private void freeze() {
+        rules.replaceAll((k, m) -> Collections.unmodifiableMap(m));
+        rules = Collections.unmodifiableMap(rules);
+        rulesWithCustomPredicate = Collections.unmodifiableList(rulesWithCustomPredicate);
+    }
+
+    /**
+     * Function that performs a map lookup first based on the type root, then on any of its
+     * families.
+     */
+    private static <T> T lookupTypeInMap(Map<Object, T> map, LogicalTypeRoot type) {
+        T out = map.get(type);
+        if (out == null) {
+            /* lookup by any family matching */
+            for (LogicalTypeFamily family : type.getFamilies()) {
+                out = map.get(family);
+                if (out != null) {
+                    break;

Review comment:
       ```suggestion
                       return out;
   ```

##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastRulePredicate.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.function.BiPredicate;
+
+/**
+ * In order to apply a {@link CastRule}, the runtime checks if a particular rule matches the tuple
+ * of input and target type using this class. In particular, a rule is applied if:
+ *
+ * <ol>
+ *   <li>{@link #getTargetTypes()} includes the {@link LogicalTypeRoot} of target type and either
+ *       <ol>
+ *         <li>{@link #getInputTypes()} includes the {@link LogicalTypeRoot} of input type or
+ *         <li>{@link #getInputTypeFamilies()} includes one of the {@link LogicalTypeFamily} of
+ *             input type
+ *       </ol>
+ *   <li>Or {@link #getTargetTypeFamilies()} includes one of the {@link LogicalTypeFamily} of target
+ *       type and either
+ *       <ol>
+ *         <li>{@link #getInputTypes()} includes the {@link LogicalTypeRoot} of input type or
+ *         <li>{@link #getInputTypeFamilies()} includes one of the {@link LogicalTypeFamily} of
+ *             input type
+ *       </ol>
+ *   <li>Or, if {@link #getCustomPredicate()} is not null, the input type and target type matches

Review comment:
       Maybe clarify that this is for when we want to match exact concrete types, maybe use an example for when this is useful.

##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastRule.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.time.ZoneId;
+
+/**
+ * Casting executor factory performs the pre-flight of a casting operation.

Review comment:
       I think `factory` should be changed to something else ?

##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastExecutor.java
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.api.TableException;
+
+/**
+ * Interface to model a function that performs the casting of one value to another type.

Review comment:
       ```suggestion
    * Interface to model a function that performs the casting of a value from one type to another.
   ```

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} starting from the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input data type and target data type. Returns
+     * {@code null} if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(
+            LogicalType inputDataType, LogicalType targetDataType) {
+        return INSTANCE.internalResolve(inputDataType, targetDataType);
+    }
+
+    /** @see #resolve(LogicalType, LogicalType) */
+    public static @Nullable CastRule<?, ?> resolve(
+            DataType inputDataType, DataType targetDataType) {
+        return resolve(inputDataType.getLogicalType(), targetDataType.getLogicalType());
+    }
+
+    /* ------ Implementation ------ */
+
+    private static final CastRuleProvider INSTANCE = new CastRuleProvider();
+
+    static {
+        INSTANCE.addRule(TimestampToStringCastRule$.MODULE$)
+                .addRule(IdentityCastRule$.MODULE$)
+                .addRule(UpcastToBigIntCastRule$.MODULE$)
+                .freeze();
+    }
+
+    // Map<Target family or root, Map<Input family or root, rule>>
+    private Map<Object, Map<Object, CastRule<?, ?>>> rules = new HashMap<>();
+    private List<CastRule<?, ?>> rulesWithCustomPredicate = new ArrayList<>();
+
+    private CastRuleProvider addRule(CastRule<?, ?> rule) {
+        CastRulePredicate predicate = rule.getPredicateDefinition();
+
+        for (LogicalTypeRoot targetTypeRoot : predicate.getTargetTypes()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeRoot, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+        for (LogicalTypeFamily targetTypeFamily : predicate.getTargetTypeFamilies()) {
+            Map<Object, CastRule<?, ?>> map =
+                    rules.computeIfAbsent(targetTypeFamily, k -> new HashMap<>());
+            for (LogicalTypeRoot inputTypeRoot : predicate.getInputTypes()) {
+                map.put(inputTypeRoot, rule);
+            }
+            for (LogicalTypeFamily inputTypeFamily : predicate.getInputTypeFamilies()) {
+                map.put(inputTypeFamily, rule);
+            }
+        }
+
+        if (predicate.getCustomPredicate() != null) {
+            rulesWithCustomPredicate.add(rule);
+        }
+
+        return this;
+    }
+
+    private CastRule<?, ?> internalResolve(LogicalType inputDataType, LogicalType targetDataType) {
+        // Lookup by target type
+        Map<Object, CastRule<?, ?>> inputTypeToCastRuleMap =
+                lookupTypeInMap(rules, targetDataType.getTypeRoot());
+
+        // If nothing found, just return null
+        if (inputTypeToCastRuleMap == null) {
+            return null;

Review comment:
       Why return null here? shouldn't we continue with  the custom predicate rule in this case?

##########
File path: flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/data/casting/rules/AbstractCharacterFamilyTargetRule.scala
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting.rules
+
+import org.apache.flink.table.data.StringData
+import org.apache.flink.table.data.binary.BinaryStringData
+import org.apache.flink.table.data.casting.{CastExpression, CastRulePredicate, CodeGeneratorCastRule}
+import org.apache.flink.table.planner.codegen.CodeGenUtils.className
+import org.apache.flink.table.types.logical.{CharType, LogicalType, VarCharType}
+
+abstract class AbstractCharacterFamilyTargetRule[IN](predicate: CastRulePredicate)
+  extends AbstractCodeGeneratorCastRule[IN, StringData](predicate) {
+
+  def generateStringExpression(context: CodeGeneratorCastRule.Context,
+                               inputArgumentName: String,
+                               inputLogicalType: LogicalType,
+                               targetLogicalType: LogicalType): String
+
+  override def generate(
+                         context: CodeGeneratorCastRule.Context,
+                         inputArgumentName: String,
+                         inputLogicalType: LogicalType,
+                         targetLogicalType: LogicalType): CastExpression = {
+    val limit: Int = targetLogicalType match {

Review comment:
       I'd suggest to not change/fix behaviour with these PR, just replace existing rules, as a guide for the upcoming changes, but fixing some behaviour in parallel with introducing this new layout can lead to confusion, also with the jira tickets that this PR addresses.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastExpression.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.util.Objects;
+
+/** Generated cast expression result. */

Review comment:
       Could you please make it more descriptive? It holds the code needed by the code generator to perform the actual casting.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737514777



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && target.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && isValidArrayCasting(
+                                                        ((ArrayType) input).getElementType(),
+                                                        ((ArrayType) target).getElementType()))
+                        .build());
+    }
+
+    private static boolean isValidArrayCasting(
+            LogicalType innerInputType, LogicalType innerTargetType) {
+        return CastRuleProvider.resolve(innerInputType, innerTargetType) != null;
+    }
+
+    @SuppressWarnings("rawtypes")
+    @Override
+    protected String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        LogicalType innerInputType = ((ArrayType) inputLogicalType).getElementType();
+        LogicalType innerTargetType = ((ArrayType) targetLogicalType).getElementType();
+
+        String innerTargetTypeTerm = arrayElementType(innerTargetType);
+        String arraySize = inputTerm + ".size()";
+        String objArrayTerm = newName("objArray");
+
+        CodeGeneratorCastRule<?, ?> innerCastRule =
+                (CodeGeneratorCastRule) CastRuleProvider.resolve(innerInputType, innerTargetType);
+
+        StringBuilder result = new StringBuilder();
+        result.append(
+                innerTargetTypeTerm
+                        + "[] "
+                        + objArrayTerm
+                        + " = new "
+                        + innerTargetTypeTerm
+                        + "["
+                        + arraySize
+                        + "];\n");
+
+        result.append("for (int i = 0; i < " + arraySize + "; i++) {\n");
+        CastCodeBlock codeBlock =
+                innerCastRule.generateCodeBlock(
+                        context,
+                        inputTerm + "." + getArrayElement(innerInputType, "i"),
+                        innerInputType.copy(false), // Null check is done at the array access level
+                        innerTargetType);
+
+        String innerElementCode =
+                codeBlock.getCode()
+                        + "\n"
+                        + objArrayTerm
+                        + "[i] = "
+                        + codeBlock.getReturnTerm()
+                        + ";\n";
+
+        // Add null check if inner type is nullable
+        if (innerInputType.isNullable()) {
+            result.append("if (" + inputTerm + ".isNullAt(i)) {\n")
+                    .append(objArrayTerm + "[i] = null;\n")
+                    .append("} else {\n")
+                    .append(innerElementCode)
+                    .append("}\n");
+        } else {
+            result.append(innerElementCode);
+        }
+
+        result.append("}\n");
+
+        result.append(
+                returnVariable
+                        + " = new "
+                        + className(GenericArrayData.class)
+                        + "("
+                        + objArrayTerm
+                        + ");\n");
+
+        return result.toString();
+    }
+
+    private static String arrayElementType(LogicalType t) {

Review comment:
       I couldn't find any, we have `boxedTypeTermForType` and `primitiveTypeTermForType` but the issue here is that, unless I'm using a primitive, I need a `Object[]` type. Let me know if you have another idea in mind for that.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528) 
   * 1b54a2ef6c25c92bd92bb43ab76218c9aa42e849 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528) 
   * 1b54a2ef6c25c92bd92bb43ab76218c9aa42e849 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572) 
   * ec3a0972e352ea5439c09043cc0c02a91c063cc2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1b54a2ef6c25c92bd92bb43ab76218c9aa42e849 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533) 
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r733714592



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/casting/CastRule.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.time.ZoneId;
+
+/**
+ * Casting executor factory performs the pre-flight of a casting operation.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+public interface CastRule<IN, OUT> {
+
+    /** @see CastRulePredicate for more details about a cast rule predicate definition */
+    CastRulePredicate getPredicateDefinition();
+
+    /**
+     * Create a casting executor starting from the provided input type. The returned {@link
+     * CastExecutor} assumes the input value is using the internal data type, and it's a valid value
+     * for the provided {@code targetLogicalType}.
+     */
+    CastExecutor<IN, OUT> create(

Review comment:
       The `CastRuleProvider` can pass the type to the `CastRule` once it finds a matching one. There is no need to pass the same parameters twice. No outer class needs to directly use `CastRule`. The linked pattern matching can also happen on `CodeGeneratedCastExecutor` if a getter for `code` is provided.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572) 
   * ec3a0972e352ea5439c09043cc0c02a91c063cc2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266) 
   * 2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281) 
   * d16cc0f9e2290406d788453db9f771fe6cbc8637 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] matriv commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
matriv commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r736455472



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/utils/CastExecutor.java
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.utils;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.api.TableException;
+
+import javax.annotation.Nullable;
+
+/**
+ * Interface to model a function that performs the casting of a value from one type to another.
+ *
+ * <p>This interface is serializable in order to be embedded in the runtime codegen.

Review comment:
       I guess this is not valid anymore?

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractCodeGeneratorCastRule.java
##########
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRule;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.generated.CompileUtils;
+import org.apache.flink.table.runtime.typeutils.InternalSerializers;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.AbstractMap.SimpleImmutableEntry;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * Base class for {@link CastRule} supporting code generation. This base class implements {@link
+ * #create(CastRule.Context, LogicalType, LogicalType)} compiling the generated code block into a
+ * {@link CastExecutor} implementation.
+ *
+ * <p>We suggest implementing {@link CodeGeneratorCastRule} starting from {@link
+ * AbstractNullAwareCodeGeneratorCastRule}, which provides nullability checks, or from {@link
+ * AbstractExpressionCodeGeneratorCastRule} to generate simple expression casts.
+ */
+public abstract class AbstractCodeGeneratorCastRule<IN, OUT> extends AbstractCastRule<IN, OUT>
+        implements CodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CastExecutor<IN, OUT> create(
+            CastRule.Context castRuleContext,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        final String inputTerm = "_myInput";
+        final String className = CodeGenUtils.newName("GeneratedCastExecutor");
+        final String inputTypeTerm = CodeGenUtils.boxedTypeTermForType(inputLogicalType);
+        final String targetTypeTerm = CodeGenUtils.boxedTypeTermForType(targetLogicalType);
+
+        final CastExecutorCodeGeneratorContext ctx =
+                new CastExecutorCodeGeneratorContext(castRuleContext);
+        final CastCodeBlock codeBlock =
+                generateCodeBlock(ctx, inputTerm, inputLogicalType, targetLogicalType);
+
+        // Class fields can contain type serializers
+        final String classFieldDecls =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "private final TypeSerializer " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        final String constructorSignature =
+                "public "
+                        + className
+                        + "("
+                        + ctx.getDeclaredTypeSerializers().stream()
+                                .map(name -> "TypeSerializer " + name)
+                                .collect(Collectors.joining(", "))
+                        + ")";
+        final String constructorBody =
+                ctx.getDeclaredTypeSerializers().stream()
+                        .map(name -> "this." + name + " = " + name + ";\n")
+                        .collect(Collectors.joining());
+
+        // Because janino doesn't support generics, we need to manually cast the input variable of
+        // the cast method
+        final String functionSignature =
+                "@Override public Object cast(Object _myInputObj) throws "
+                        + CodeGenUtils.className(TableException.class);
+        final String inputVarDecl =
+                inputTypeTerm + " " + inputTerm + " = (" + inputTypeTerm + ") _myInputObj;\n";
+
+        final String returnStmt = "return " + codeBlock.getReturnTerm() + ";\n";
+
+        final String classCode =

Review comment:
       Just a remark: this part is a good example imho, to disable the code format checks, and ident the parts of the string in a more readable way.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CastCodeBlock.java
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+
+import java.util.Objects;
+
+/**
+ * Generated cast code block result. This POJO contains the Java code of the block performing the
+ * cast, the output isNull term and the output variable containing the cast result. It is guaranteed
+ * that the result and isNull variables can be accessed within the outside scope of the code.

Review comment:
       Maybe: 
   ```suggestion
    * that the result and isNull variables can be accessed within the external scope of the code.
   ```
   reads better.

##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/data/utils/CastExecutor.java
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.utils;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.api.TableException;
+
+import javax.annotation.Nullable;
+
+/**
+ * Interface to model a function that performs the casting of a value from one type to another.
+ *
+ * <p>This interface is serializable in order to be embedded in the runtime codegen.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+@Internal
+@FunctionalInterface
+public interface CastExecutor<IN, OUT> {
+    /**
+     * Cast the input value. The output is null only and only if the input is null. The method

Review comment:
       Imho we should add a TODO and link to https://issues.apache.org/jira/browse/FLINK-24385, since only then normal cast would throw errors.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractExpressionCodeGeneratorCastRule.java
##########
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.table.planner.functions.casting.CastRule;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.runtime.generated.CompileUtils;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.utils.LogicalTypeUtils;
+
+import java.util.Collections;
+
+/**
+ * Base class for cast rules that supports code generation, requiring only an expression to perform
+ * the cast. If the casting logic requires to generate several statements, look at {@link
+ * AbstractNullAwareCodeGeneratorCastRule}.
+ */
+@Internal
+public abstract class AbstractExpressionCodeGeneratorCastRule<IN, OUT>
+        extends AbstractNullAwareCodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractExpressionCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    abstract String generateExpression(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType);
+
+    @Override
+    protected String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        return returnVariable
+                + " = "
+                + generateExpression(context, inputTerm, inputLogicalType, targetLogicalType)
+                + ";";
+    }
+
+    @Override
+    public CastExecutor<IN, OUT> create(
+            CastRule.Context context, LogicalType inputLogicalType, LogicalType targetLogicalType) {
+        final String inputArgumentName = "inputValue";
+
+        final String expression =
+                generateExpression(
+                        createCodeGeneratorCastRuleContext(context),
+                        inputArgumentName,
+                        inputLogicalType,
+                        targetLogicalType);
+
+        return new CodeGeneratedExpressionCastExecutor<>(
+                CompileUtils.compileExpression(
+                        expression,
+                        Collections.singletonList(inputArgumentName),
+                        Collections.singletonList(
+                                LogicalTypeUtils.toInternalConversionClass(inputLogicalType)),
+                        LogicalTypeUtils.toInternalConversionClass(targetLogicalType)));
+    }
+
+    private static CodeGeneratorCastRule.Context createCodeGeneratorCastRuleContext(
+            CastRule.Context ctx) {
+        return new CodeGeneratorCastRule.Context() {
+            @Override
+            public String getSessionTimeZoneTerm() {
+                return "java.util.TimeZone.getTimeZone(\"" + ctx.getSessionZoneId().getId() + "\")";
+            }
+
+            @Override
+            public String declareVariable(String type, String variablePrefix) {
+                throw new IllegalStateException(

Review comment:
       Here and below, maybe `UnsupportedOperationException` is more suitable?

##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/CastFunctionITCase.java
##########
@@ -875,6 +876,27 @@ protected Configuration configuration() {
                         // single type
                         // .fromCase(INT(), 10, new int[] {10})
                         .fromCase(ARRAY(INT()), new int[] {1, 2, 3}, new Integer[] {1, 2, 3})
+                        .build(),
+                CastTestSpecBuilder.testCastTo(ARRAY(STRING().nullable()))

Review comment:
       With this implementation probably you can remove above the comments referring to: https://issues.apache.org/jira/browse/FLINK-17321?

##########
File path: flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/generated/GeneratedClass.java
##########
@@ -71,7 +71,7 @@ public T newInstance(ClassLoader classLoader) {
                     // Because Constructor.newInstance(Object... initargs), we need to load
                     // references into a new Object[], otherwise it cannot be compiled.
                     .newInstance(new Object[] {references});
-        } catch (Exception e) {
+        } catch (Throwable e) {

Review comment:
       Why is this change needed?

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/CastRuleUtils.java
##########
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.planner.codegen.CodeGenUtils;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+class CastRuleUtils {

Review comment:
       Wouldn't be better for this class to be `final`, and the methods package private, is it expected to extend this class in the future?




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737493902



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/IdentityCastRule.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.util.Objects;
+
+/** Identity casting rule. */
+@Internal
+public class IdentityCastRule extends AbstractCodeGeneratorCastRule<Object, Object> {
+
+    public static final IdentityCastRule INSTANCE = new IdentityCastRule();
+
+    private IdentityCastRule() {
+        super(CastRulePredicate.builder().predicate(Objects::equals).build());
+    }
+
+    @Override
+    public CastCodeBlock generateCodeBlock(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType) {
+        String isNullTerm = inputLogicalType.isNullable() ? "(" + inputTerm + " == null)" : "false";
+        return new CastCodeBlock("", inputTerm, isNullTerm);

Review comment:
       No, the identity casting is performed in the same way as before, just copying the input term without generating any new code: https://github.com/apache/flink/blob/fbc086f2fd63dac4af3e104ba4011e864781139a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala#L991




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737454676



##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/CastFunctionITCase.java
##########
@@ -875,6 +876,27 @@ protected Configuration configuration() {
                         // single type
                         // .fromCase(INT(), 10, new int[] {10})
                         .fromCase(ARRAY(INT()), new int[] {1, 2, 3}, new Integer[] {1, 2, 3})
+                        .build(),
+                CastTestSpecBuilder.testCastTo(ARRAY(STRING().nullable()))

Review comment:
       I would not tbh, because "collection" types also includes map, which we don't support here.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 43974816c1bd08cbdb58535913853fa115fcaebd Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 43974816c1bd08cbdb58535913853fa115fcaebd Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328) 
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r734329500



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratedCastExecutor.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import org.codehaus.janino.ExpressionEvaluator;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Cast executor which can be instantiated starting from an expression code.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+class CodeGeneratedCastExecutor<IN, OUT> implements CastExecutor<IN, OUT> {

Review comment:
       Either we remove this declaration or we fix the implementation. Take a look at how `DataStructureConverter` achieves this.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737497146



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/ArrayToArrayCastRule.java
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.table.data.ArrayData;
+import org.apache.flink.table.data.GenericArrayData;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CastRuleProvider;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.ArrayType;
+import org.apache.flink.table.types.logical.DistinctType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.className;
+import static org.apache.flink.table.planner.codegen.CodeGenUtils.newName;
+import static org.apache.flink.table.planner.functions.casting.rules.CastRuleUtils.functionCall;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getFieldCount;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision;
+import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getScale;
+
+/** Array to array casting rule. */
+public class ArrayToArrayCastRule
+        extends AbstractNullAwareCodeGeneratorCastRule<ArrayData, ArrayData> {
+
+    public static final ArrayToArrayCastRule INSTANCE = new ArrayToArrayCastRule();
+
+    private ArrayToArrayCastRule() {
+        super(
+                CastRulePredicate.builder()
+                        .predicate(
+                                (input, target) ->
+                                        input.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && target.getTypeRoot() == LogicalTypeRoot.ARRAY
+                                                && isValidArrayCasting(

Review comment:
       > LogicalTypeCasts.supportsExplicitCast
   
   I'm not using it because this rule is meant to support only rules from the new stack. Once we'll have everything ported to the new stack, `CastRuleProvider` should always resolve a rule when `LogicalTypeCasts.supportsExplicitCast` returns true.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737499573



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractNullAwareCodeGeneratorCastRule.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Base class for cast rules supporting code generation. This class inherits from {@link
+ * AbstractCodeGeneratorCastRule} and takes care of nullability checks.
+ */
+@Internal
+public abstract class AbstractNullAwareCodeGeneratorCastRule<IN, OUT>
+        extends AbstractCodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractNullAwareCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    /**
+     * This method doesn't need to take care of null checks handling of input values.
+     * Implementations should write the cast result in the {@code returnVariable}.
+     */
+    protected abstract String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType);
+
+    @Override
+    public CastCodeBlock generateCodeBlock(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            LogicalType inputType,
+            LogicalType targetType) {
+        StringBuilder resultCode = new StringBuilder();
+
+        // Result of a casting can be null only and only if the input is null
+        boolean isResultNullable = inputType.isNullable();
+        String nullTerm;
+        if (isResultNullable) {
+            nullTerm = context.declareVariable("boolean", "isNull");
+            resultCode.append(nullTerm).append(" = ").append(inputTerm).append(" == null;\n");
+        } else {
+            nullTerm = "false";
+        }
+
+        // Create the result value variable
+        String returnTerm = context.declareVariable(targetType, "result");
+
+        // Generate the code block
+        String castCodeBlock =
+                this.generateCodeBlockInternal(
+                        context, inputTerm, returnTerm, inputType, targetType);
+
+        if (isResultNullable) {
+            resultCode
+                    .append("if (!")

Review comment:
       I don't understand what's your suggestion here, should we keep all `+` or `StringBuilder`? I personally just tried to use whatever fits best IMO, but I'm ok if we wanna decide for trying to stick to a precise code style. 




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "953874367",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572) 
   * ec3a0972e352ea5439c09043cc0c02a91c063cc2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec3a0972e352ea5439c09043cc0c02a91c063cc2",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576",
       "triggerID" : "953874367",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * ec3a0972e352ea5439c09043cc0c02a91c063cc2 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25576) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] matriv commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
matriv commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r738217476



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/rules/AbstractNullAwareCodeGeneratorCastRule.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting.rules;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.functions.casting.CastCodeBlock;
+import org.apache.flink.table.planner.functions.casting.CastRulePredicate;
+import org.apache.flink.table.planner.functions.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.LogicalType;
+
+/**
+ * Base class for cast rules supporting code generation. This class inherits from {@link
+ * AbstractCodeGeneratorCastRule} and takes care of nullability checks.
+ */
+@Internal
+public abstract class AbstractNullAwareCodeGeneratorCastRule<IN, OUT>
+        extends AbstractCodeGeneratorCastRule<IN, OUT> {
+
+    protected AbstractNullAwareCodeGeneratorCastRule(CastRulePredicate predicate) {
+        super(predicate);
+    }
+
+    /**
+     * This method doesn't need to take care of null checks handling of input values.
+     * Implementations should write the cast result in the {@code returnVariable}.
+     */
+    protected abstract String generateCodeBlockInternal(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            String returnVariable,
+            LogicalType inputLogicalType,
+            LogicalType targetLogicalType);
+
+    @Override
+    public CastCodeBlock generateCodeBlock(
+            CodeGeneratorCastRule.Context context,
+            String inputTerm,
+            LogicalType inputType,
+            LogicalType targetType) {
+        StringBuilder resultCode = new StringBuilder();
+
+        // Result of a casting can be null only and only if the input is null
+        boolean isResultNullable = inputType.isNullable();
+        String nullTerm;
+        if (isResultNullable) {
+            nullTerm = context.declareVariable("boolean", "isNull");
+            resultCode.append(nullTerm).append(" = ").append(inputTerm).append(" == null;\n");
+        } else {
+            nullTerm = "false";
+        }
+
+        // Create the result value variable
+        String returnTerm = context.declareVariable(targetType, "result");
+
+        // Generate the code block
+        String castCodeBlock =
+                this.generateCodeBlockInternal(
+                        context, inputTerm, returnTerm, inputType, targetType);
+
+        if (isResultNullable) {
+            resultCode
+                    .append("if (!")

Review comment:
       Personally, I don't mind much, maybe it's nicer to be more consistent so if there is no for loop or so, we can stick to the `+`. I think @twalthr for example refers to: https://github.com/apache/flink/pull/17522/files#diff-f6381501ccb5f995a532369eafaaa4d3b0f34bda58e9519216753bfb35e35558R120 in the `AbstractCodeGeneratorCastRule` where `+` is used to construct the string.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-953758893


   Rebased and ready to be merged


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] matriv commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
matriv commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r732780163



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.data.casting.rules.IdentityCastRule$;
+import org.apache.flink.table.data.casting.rules.TimestampToStringCastRule$;
+import org.apache.flink.table.data.casting.rules.UpcastToBigIntCastRule$;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} starting from the input and the target type. */

Review comment:
       I would then just drop the `starting from`, and use by using lookup tables bases on input and target type.
   I just think that stating `starting from` reveals implementation detail which is in fact opposite from the one actually followed.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 43974816c1bd08cbdb58535913853fa115fcaebd Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328) 
   * 3f69f95a54c392c758d8f76922efbfd810983baf UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r734328097



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratedCastExecutor.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import org.codehaus.janino.ExpressionEvaluator;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Cast executor which can be instantiated starting from an expression code.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+class CodeGeneratedCastExecutor<IN, OUT> implements CastExecutor<IN, OUT> {

Review comment:
       The class is declared as serializable but in reality it is not because the implementation violates the declaration:
   
   ```
           Object o =
                   CastRuleProvider.resolve(DataTypes.INT(), DataTypes.BIGINT())
                           .create(
                                   CastRule.Context.create(ZoneId.of("UTC")),
                                   DataTypes.INT().getLogicalType(),
                                   DataTypes.BIGINT().getLogicalType());
   
           EncodingUtils.encodeObjectToString(o);
   
   ```
   
   leads to
   
   ```
   Exception in thread "main" org.apache.flink.table.api.ValidationException: Unable to serialize object 'org.apache.flink.table.data.casting.CodeGeneratedCastExecutor@538613b3' of class 'org.apache.flink.table.data.casting.CodeGeneratedCastExecutor'.
   	at org.apache.flink.table.utils.EncodingUtils.encodeObjectToString(EncodingUtils.java:75)
   	at org.apache.flink.table.examples.java.basics.WordCountSQLExample.main(WordCountSQLExample.java:47)
   Caused by: java.io.NotSerializableException: org.codehaus.janino.ExpressionEvaluator
   	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
   	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
   	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
   	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
   	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
   	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
   	at org.apache.flink.util.InstantiationUtil.serializeObject(InstantiationUtil.java:632)
   	at org.apache.flink.table.utils.EncodingUtils.encodeObjectToString(EncodingUtils.java:68)
   	... 1 more
   ```




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r732012043



##########
File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/data/casting/CastRulesTest.java
##########
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting;
+
+import org.apache.flink.table.data.StringData;
+import org.apache.flink.table.data.TimestampData;
+import org.apache.flink.table.types.DataType;
+
+import org.junit.jupiter.api.DynamicTest;
+import org.junit.jupiter.api.TestFactory;
+
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.apache.flink.table.api.DataTypes.BIGINT;
+import static org.apache.flink.table.api.DataTypes.INT;
+import static org.apache.flink.table.api.DataTypes.SMALLINT;
+import static org.apache.flink.table.api.DataTypes.STRING;
+import static org.apache.flink.table.api.DataTypes.TIMESTAMP;
+import static org.apache.flink.table.api.DataTypes.TIMESTAMP_LTZ;
+import static org.apache.flink.table.api.DataTypes.TINYINT;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+class CastRulesTest {

Review comment:
       No need to make test classes public in junit 5




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266) 
   * 2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281) 
   * d16cc0f9e2290406d788453db9f771fe6cbc8637 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r734299771



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratedCastExecutor.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import org.codehaus.janino.ExpressionEvaluator;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Cast executor which can be instantiated starting from an expression code.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+class CodeGeneratedCastExecutor<IN, OUT> implements CastExecutor<IN, OUT> {

Review comment:
       This class is serializable because `CastExecutor` is, but this is never going to be used by our code generation, this is only going to be used by the "to string" `PrintUtils`.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] twalthr commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
twalthr commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r734267465



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CastExpression.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.table.types.logical.LogicalType;
+
+import java.util.Objects;
+
+/**
+ * Generated cast expression result. This POJO contains the Java code of the expression and the
+ * returned type.
+ */
+public class CastExpression {

Review comment:
       annotate all added classes with `@Internal` or `@PublicEvolving`

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratedCastExecutor.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import org.codehaus.janino.ExpressionEvaluator;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Cast executor which can be instantiated starting from an expression code.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+class CodeGeneratedCastExecutor<IN, OUT> implements CastExecutor<IN, OUT> {

Review comment:
       Is this class `Serializable`? Usually, classes with code generation need to be serialized with a string and their `open()` method calls the compiler after shipping. This is also the case for `DataStructureConverter` e.g. structured types which also use code generation. We can also remove this interface for now.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/rules/UpcastToBigIntCastRule.java
##########
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.data.casting.rules;
+
+import org.apache.flink.table.data.casting.CastExpression;
+import org.apache.flink.table.data.casting.CastRulePredicate;
+import org.apache.flink.table.data.casting.CodeGeneratorCastRule;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+/** Upcasting to long for smaller types. */
+public class UpcastToBigIntCastRule extends AbstractCodeGeneratorCastRule<Object, Long> {
+
+    public static final UpcastToBigIntCastRule INSTANCE = new UpcastToBigIntCastRule();
+
+    protected UpcastToBigIntCastRule() {

Review comment:
       why not private?

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CastRuleProvider.java
##########
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.planner.functions.casting.rules.IdentityCastRule;
+import org.apache.flink.table.planner.functions.casting.rules.TimestampToStringCastRule;
+import org.apache.flink.table.planner.functions.casting.rules.UpcastToBigIntCastRule;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.types.logical.LogicalTypeFamily;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** This class resolves {@link CastRule} using the input and the target type. */
+@Internal
+public class CastRuleProvider {
+
+    /* ------- Entrypoint ------- */
+
+    /**
+     * Resolve a {@link CastRule} for the provided input type and target type. Returns {@code null}
+     * if no rule can be resolved.
+     */
+    public static @Nullable CastRule<?, ?> resolve(LogicalType inputType, LogicalType targetType) {

Review comment:
       My comment that you have to pass the same arguments twice until you get an executor is still not addressed.

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/data/casting/CastRuleProvider.java
##########
@@ -30,7 +30,6 @@
 import javax.annotation.Nullable;

Review comment:
       Regarding commit naming: This is not a `[hotfix]` commit. Hotfix commits will be visible in the log after merging. This commit is a fixup commit that the committer should squash into the previous one.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310) 
   * 43974816c1bd08cbdb58535913853fa115fcaebd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r734375550



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratedCastExecutor.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import org.codehaus.janino.ExpressionEvaluator;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Cast executor which can be instantiated starting from an expression code.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+class CodeGeneratedCastExecutor<IN, OUT> implements CastExecutor<IN, OUT> {

Review comment:
       So the initial reason to have `CastExecutor` serializable was to embed it in the codegen, but I think I can just remove `Serializable` now because we don't need it anymore




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281) 
   * d16cc0f9e2290406d788453db9f771fe6cbc8637 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * def050276334d930dec36d5cffe52a47c1bf039d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223) 
   * 01af2774693597d1c4f7c23b9ce911fa800645a6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245) 
   * fbbcc1b08944a997de2adba6e8a47f275f338e89 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260) 
   * c5310e9d376b11af0bdbb9d3f420129a5cec7975 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3f69f95a54c392c758d8f76922efbfd810983baf Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358) 
   * c25eee9cc5022426c3f0703e65ec5e41722b9975 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565",
       "triggerID" : "d39635a3c71fcb6603fa5c97a5e46fbc3eb45052",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572",
       "triggerID" : "bdb3dae39d25c075eb223028c7c82ea3f8ea6e90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   * d39635a3c71fcb6603fa5c97a5e46fbc3eb45052 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25565) 
   * bdb3dae39d25c075eb223028c7c82ea3f8ea6e90 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25572) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1740f472b8e16bf6759756822d177b60f3b0c42c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456) 
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e4338fda5674d90209fd26e9c4e6b620b4f87bba Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524) 
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528) 
   * 1b54a2ef6c25c92bd92bb43ab76218c9aa42e849 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] slinkydeveloper commented on a change in pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
slinkydeveloper commented on a change in pull request #17522:
URL: https://github.com/apache/flink/pull/17522#discussion_r737727158



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/casting/CodeGeneratedCastExecutor.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.functions.casting;
+
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.data.utils.CastExecutor;
+import org.apache.flink.util.FlinkRuntimeException;
+
+import org.codehaus.janino.ExpressionEvaluator;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Cast executor which can be instantiated starting from an expression code.
+ *
+ * @param <IN> Input internal type
+ * @param <OUT> Output internal type
+ */
+class CodeGeneratedCastExecutor<IN, OUT> implements CastExecutor<IN, OUT> {

Review comment:
       I think this is addessed, reopen if you need it




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #17522: [FLINK-24462][table] Introduce CastRule interface to reorganize casting code

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17522:
URL: https://github.com/apache/flink/pull/17522#issuecomment-946700003


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25223",
       "triggerID" : "def050276334d930dec36d5cffe52a47c1bf039d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25245",
       "triggerID" : "01af2774693597d1c4f7c23b9ce911fa800645a6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25260",
       "triggerID" : "fbbcc1b08944a997de2adba6e8a47f275f338e89",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25266",
       "triggerID" : "c5310e9d376b11af0bdbb9d3f420129a5cec7975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25281",
       "triggerID" : "2cacbb5c9e9c01e5d047c4a65116c2df43b8ebbf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25283",
       "triggerID" : "d16cc0f9e2290406d788453db9f771fe6cbc8637",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25310",
       "triggerID" : "ec1ebf9f4ddb11927d3cc8c32ab4967c1202ad49",
       "triggerType" : "PUSH"
     }, {
       "hash" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25328",
       "triggerID" : "43974816c1bd08cbdb58535913853fa115fcaebd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25358",
       "triggerID" : "3f69f95a54c392c758d8f76922efbfd810983baf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25453",
       "triggerID" : "c25eee9cc5022426c3f0703e65ec5e41722b9975",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25456",
       "triggerID" : "1740f472b8e16bf6759756822d177b60f3b0c42c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25524",
       "triggerID" : "e4338fda5674d90209fd26e9c4e6b620b4f87bba",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25528",
       "triggerID" : "f41c8f6a1eef9fb5a6ecf0d44d4501888cc6b3b2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533",
       "triggerID" : "1b54a2ef6c25c92bd92bb43ab76218c9aa42e849",
       "triggerType" : "PUSH"
     }, {
       "hash" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539",
       "triggerID" : "87d6ba91b3b6a734f8875b8b6ec93bad513ee805",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1b54a2ef6c25c92bd92bb43ab76218c9aa42e849 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25533) 
   * 87d6ba91b3b6a734f8875b8b6ec93bad513ee805 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=25539) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org