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 2020/08/03 08:55:11 UTC

[GitHub] [flink] danny0405 opened a new pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

danny0405 opened a new pull request #13050:
URL: https://github.com/apache/flink/pull/13050


   …view which contains a UDTF call
   
   ## What is the purpose of the change
   
   This patch fix the problem that a table function can not reference the `JOIN` left items for `CREATE VIEW` query.
   
   
   ## Brief change log
   
     - Fix the issue in blink planner
     - Add UT
   
   
   ## Verifying this change
   
   Added UT.
   
   ## 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/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? 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.

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



[GitHub] [flink] danny0405 commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   Finally i have added a new component named `Expander` for the sql identifier expanding, so that we do not need to depend on the Calcite upgrade, also this would avoid the expanding logic to be buggy again and again.


----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752",
       "triggerID" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da58a528949de503a38c69aca6ea4d1e29b2beea Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8559c87345749d7a627fd4ae4d4d58141a53639e Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] danny0405 commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   > Are we planning to bump Calcite version for 1.12? @wuchong @twalthr
   > 
   > If we do, I'd prefer we do not add this workaround. If we don't the PR looks good to me
   
   I'm afraid there is no time for the Calcite version bump for 1.12, the recent versions of Calcite made many breaking changes and it is very probably introduces bugs, need a full local test before we decide if to upgrade.


----------------------------------------------------------------
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.

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



[GitHub] [flink] danny0405 commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   @dawidwys Can you take a look for this fix, thanks in advance ~


----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586) 
   * 44ba50fd578d65572ddfea8b09e0e001f9ea530b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] dawidwys commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   Are we planning to bump Calcite version for 1.12? @wuchong @twalthr 
   
   If we do, I'd prefer we do not add this workaround. If we don't the PR looks good to me


----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1a2f39a71a931295f82a9bdbd36f2707f42298dd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] dawidwys commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   Thanks for the update. LGTM


----------------------------------------------------------------
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.

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



[GitHub] [flink] dawidwys commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/optimize/program/FlinkChainedProgram.scala
##########
@@ -62,8 +62,8 @@ class FlinkChainedProgram[OC <: FlinkOptimizeContext]
         val result = program.optimize(input, context)
         val end = System.currentTimeMillis()
 
-        if (LOG.isDebugEnabled) {
-          LOG.debug(s"optimize $name cost ${end - start} ms.\n" +
+        if (true) {

Review comment:
       unrelated 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.

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



[GitHub] [flink] twalthr edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   We will release Flink 1.12 end of October. We should bump the Calcite version until then. The longer we wait, the more difficult will an upgrade be in the future. We should aim to keep up with Calcite.


----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752",
       "triggerID" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da58a528949de503a38c69aca6ea4d1e29b2beea Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752) 
   * efe2b4b092cbce31dee74b4261ca7a20904b2000 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752",
       "triggerID" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5766",
       "triggerID" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * efe2b4b092cbce31dee74b4261ca7a20904b2000 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5766) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 128e47f58b081d6273e3c6c57ad0da76c990595f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   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 1a2f39a71a931295f82a9bdbd36f2707f42298dd (Mon Aug 03 08:57:34 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-18750).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8559c87345749d7a627fd4ae4d4d58141a53639e Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235) 
   * c44b190d9e1350fa8853fe95b9f0284090f4d0fc UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6e9b5b711ca81e18366d521f564b9ed64113bf94 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] dawidwys commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   To emphasize it again though, personally if we don't want to upgrade calcite, personally I am fine with that 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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 128e47f58b081d6273e3c6c57ad0da76c990595f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226) 
   * 6e9b5b711ca81e18366d521f564b9ed64113bf94 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e274e166aed3ffacc4ac58409aaf3384c937cb66 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146) 
   * 128e47f58b081d6273e3c6c57ad0da76c990595f UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] danny0405 commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/optimize/program/FlinkChainedProgram.scala
##########
@@ -62,8 +62,8 @@ class FlinkChainedProgram[OC <: FlinkOptimizeContext]
         val result = program.optimize(input, context)
         val end = System.currentTimeMillis()
 
-        if (LOG.isDebugEnabled) {
-          LOG.debug(s"optimize $name cost ${end - start} ms.\n" +
+        if (true) {

Review comment:
       Oops, i committed some test code, fixed.




----------------------------------------------------------------
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.

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



[GitHub] [flink] danny0405 commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {

Review comment:
       Yes, the `BridgingSqlFunction` did the function id expanding out of the scope of the `SqlValidator`, so in the code base of this patch, it does not work because `BridgingSqlFunction` id position was always `SqlParserPos.ZERO` so it can not match the original identifier.




----------------------------------------------------------------
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.

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



[GitHub] [flink] dawidwys commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {

Review comment:
       I don't know where it happens but a test like:
   ```
     @Test
     def testViewExpandingWithUDF(): Unit = {
       val tableUtil = tableTestUtil(this)
       val tableEnv = tableUtil.tableEnv
       tableEnv.createTemporaryFunction("func", classOf[PrimitiveScalarFunction])
       val createView =
         """
           |CREATE VIEW tmp_view AS
           |  SELECT func(1)
           |""".stripMargin
       tableEnv.executeSql(createView)
       val objectID = ObjectIdentifier.of(tableEnv.getCurrentCatalog,
         tableEnv.getCurrentDatabase, "tmp_view")
       val view: CatalogBaseTable = tableEnv.getCatalog(objectID.getCatalogName)
         .get().getTable(objectID.toObjectPath)
       assertThat(view.asInstanceOf[CatalogView].getExpandedQuery, is("SELECT `default_catalog`.`default_database`.`func`(1)"))
     }
   ```
   
   passes on master and fails with your changes.




----------------------------------------------------------------
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.

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



[GitHub] [flink] danny0405 commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   > Could you name a few of these breaking changes? I know about the dropped windows but what else?
   
   I listed some features i though important (very probably breaking) here:
   
   - [CALCITE-3786] The rel node digest was refactored
   - [CALCITE-3896 Top down trait pass through
   - [CALCITE-3916 Support cascades style top-down driven rule apply
   - [CALCITE-2569] UDFs that are table functions must implement SqlTableFunction and have CURSOR as their return type
   - [CALCITE-3923] Refactor how planner rules are parameterized
   
   But anyway, Calcite is a single open source community and we can not always depend on the version upgrade, and Calcite does not always evolve following Flink's request. If we have a simple workaround for a quick fix(log an issue there and remove the code when upgrade), it is better than just wait for the upgrade.
   
   This fix is critical, use can not even use the table function now in a `CREATE VIEW` and is a blocker for VVP platform.


----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752",
       "triggerID" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5766",
       "triggerID" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0aa2e599db47cf035f6d7cf0389e7caa273b5880",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5837",
       "triggerID" : "0aa2e599db47cf035f6d7cf0389e7caa273b5880",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0aa2e599db47cf035f6d7cf0389e7caa273b5880 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5837) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0358a12e3524d251396cca950c7403eee205f0d6 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 870f73394bfc42e740891a6262e1bfd97efdba56 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0358a12e3524d251396cca950c7403eee205f0d6 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636) 
   * 870f73394bfc42e740891a6262e1bfd97efdba56 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] twalthr commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   Could you name a few of these breaking changes? I know about the dropped windows but what else?


----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8559c87345749d7a627fd4ae4d4d58141a53639e Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235) 
   * c44b190d9e1350fa8853fe95b9f0284090f4d0fc Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] danny0405 commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {
+	private final FlinkPlannerImpl planner;
+
+	private Expander(FlinkPlannerImpl planner) {
+		this.planner = Objects.requireNonNull(planner);
+	}
+
+	/** Creates an Expander. **/
+	public static Expander create(FlinkPlannerImpl planner) {
+		return new Expander(planner);
+	}
+
+	/** Expands identifiers in a given SQL string, returning a {@link Expanded}. */
+	public Expanded expanded(String ori) {
+		final Map<SqlParserPos, SqlIdentifier> identifiers = new HashMap<>();
+		final SqlNode oriNode;
+		final SqlNode validated;
+		oriNode = planner.parser().parse(ori);
+		// parse again because validation is stateful, that means the node tree was probably
+		// mutated.
+		validated = planner.validate(planner.parser().parse(ori));
+		validated.accept(new SqlBasicVisitor<Void>() {
+			@Override public Void visit(SqlIdentifier identifier) {
+				identifiers.putIfAbsent(identifier.getParserPosition(), identifier);
+				return null;
+			}
+		});
+		return new Expanded(planner.config().getParserConfig(), oriNode, identifiers);
+	}
+
+	/** Result of expanding. */
+	public static class Expanded {
+		public final SqlParser.Config parserConf;
+		public final SqlNode oriNode;
+		public final Map<SqlParserPos, SqlIdentifier> identifiersMap;
+
+		Expanded(SqlParser.Config parserConf, SqlNode oriNode,
+				Map<SqlParserPos, SqlIdentifier> identifiers) {
+			this.oriNode = oriNode;
+			this.parserConf = parserConf;
+			this.identifiersMap = ImmutableMap.copyOf(identifiers);
+		}
+
+		@Override
+		public String toString() {
+			return substitute(SqlNode::toString);
+		}
+
+		/** Returns the SQL string with identifiers replaced according to the
+		 * given unparse function. */
+		public String substitute(Function<SqlNode, String> fn) {
+			final SqlShuttle shuttle = new SqlShuttle() {
+				@Override
+				public SqlNode visit(SqlIdentifier id) {
+					if (id.isStar()) {
+						return id;
+					}
+					final SqlIdentifier toReplace = identifiersMap.get(id.getParserPosition());
+					if (toReplace != null && id.names.size() >= toReplace.names.size()) {

Review comment:
       Yes, nice catch ~




----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


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

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c44b190d9e1350fa8853fe95b9f0284090f4d0fc Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273) 
   * bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


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

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 44ba50fd578d65572ddfea8b09e0e001f9ea530b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601) 
   * 0358a12e3524d251396cca950c7403eee205f0d6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] dawidwys commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   > If we have a simple workaround for a quick fix(log an issue there and remove the code when upgrade), it is better than just wait for the upgrade.
   
   I mostly agree. I am a bit sceptical though in that particular case for the following reason:
   1. That's not a simple fix, that will be backported back to Calcite. It is a workaround that disables a feature (expanding identifiers) for the `LATERAL` to work.
   2. The fix is not in Calcite classes. We must remember to remove this workaround when upgrading Calcite. It's not as simple as dropping Calcite classes.
   3. We do not need to wait for Calcite to implement that. If I understand it correctly, the fix is already released.


----------------------------------------------------------------
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.

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



[GitHub] [flink] twalthr commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   We will release Flink 1.12 end of October. We should bump the Calcite version until then.


----------------------------------------------------------------
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.

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



[GitHub] [flink] dawidwys commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/operations/SqlToOperationConverter.java
##########
@@ -676,15 +680,20 @@ private Operation convertCreateView(SqlCreateView sqlCreateView) {
 		final SqlNode query = sqlCreateView.getQuery();
 		final SqlNodeList fieldList = sqlCreateView.getFieldList();
 
-		SqlNode validateQuery = flinkPlanner.validate(query);
 		// Put the sql string unparse (getQuotedSqlString()) in front of
 		// the node conversion (toQueryOperation()),
 		// because before Calcite 1.22.0, during sql-to-rel conversion, the SqlWindow
 		// bounds state would be mutated as default when they are null (not specified).
 
 		// This bug is fixed in CALCITE-3877 of Calcite 1.23.0.
 		String originalQuery = getQuotedSqlString(query);
-		String expandedQuery = getQuotedSqlString(validateQuery);
+		SqlNode validateQuery = flinkPlanner.validate(query);

Review comment:
       Can we extract the logic from alter view and create view to a common helper method? The code is nearly identical. I am pretty sure we can extract the majority of the logic to a method like: 
   ```
   CatalogView catalogView = transformToCatalogView(SqlNode query, String comment, List<String> aliases);
   ```
   
   Right now we need to modify the code in two different places and the comments differ significantly between the two locations, even though they should be exactly the same.

##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.

Review comment:
       ```suggestion
    * Utility that expands SQL identifiers in a SQL query.
   ```

##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {
+	private final FlinkPlannerImpl planner;
+
+	private Expander(FlinkPlannerImpl planner) {
+		this.planner = Objects.requireNonNull(planner);
+	}
+
+	/** Creates an Expander. **/
+	public static Expander create(FlinkPlannerImpl planner) {
+		return new Expander(planner);
+	}
+
+	/** Expands identifiers in a given SQL string, returning a {@link Expanded}. */
+	public Expanded expanded(String ori) {
+		final Map<SqlParserPos, SqlIdentifier> identifiers = new HashMap<>();
+		final SqlNode oriNode;
+		final SqlNode validated;
+		oriNode = planner.parser().parse(ori);

Review comment:
       nit: inline assignment

##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {

Review comment:
       Will it expand function identifiers as well? Can we have a test for that case?

##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {
+	private final FlinkPlannerImpl planner;
+
+	private Expander(FlinkPlannerImpl planner) {
+		this.planner = Objects.requireNonNull(planner);
+	}
+
+	/** Creates an Expander. **/
+	public static Expander create(FlinkPlannerImpl planner) {
+		return new Expander(planner);
+	}
+
+	/** Expands identifiers in a given SQL string, returning a {@link Expanded}. */
+	public Expanded expanded(String ori) {
+		final Map<SqlParserPos, SqlIdentifier> identifiers = new HashMap<>();
+		final SqlNode oriNode;
+		final SqlNode validated;
+		oriNode = planner.parser().parse(ori);
+		// parse again because validation is stateful, that means the node tree was probably
+		// mutated.
+		validated = planner.validate(planner.parser().parse(ori));

Review comment:
       nit: inline assignment

##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {
+	private final FlinkPlannerImpl planner;
+
+	private Expander(FlinkPlannerImpl planner) {
+		this.planner = Objects.requireNonNull(planner);
+	}
+
+	/** Creates an Expander. **/
+	public static Expander create(FlinkPlannerImpl planner) {
+		return new Expander(planner);
+	}
+
+	/** Expands identifiers in a given SQL string, returning a {@link Expanded}. */
+	public Expanded expanded(String ori) {
+		final Map<SqlParserPos, SqlIdentifier> identifiers = new HashMap<>();
+		final SqlNode oriNode;
+		final SqlNode validated;
+		oriNode = planner.parser().parse(ori);
+		// parse again because validation is stateful, that means the node tree was probably
+		// mutated.
+		validated = planner.validate(planner.parser().parse(ori));
+		validated.accept(new SqlBasicVisitor<Void>() {
+			@Override public Void visit(SqlIdentifier identifier) {
+				identifiers.putIfAbsent(identifier.getParserPosition(), identifier);
+				return null;
+			}
+		});
+		return new Expanded(planner.config().getParserConfig(), oriNode, identifiers);
+	}
+
+	/** Result of expanding. */
+	public static class Expanded {
+		public final SqlParser.Config parserConf;
+		public final SqlNode oriNode;
+		public final Map<SqlParserPos, SqlIdentifier> identifiersMap;
+
+		Expanded(SqlParser.Config parserConf, SqlNode oriNode,
+				Map<SqlParserPos, SqlIdentifier> identifiers) {
+			this.oriNode = oriNode;
+			this.parserConf = parserConf;
+			this.identifiersMap = ImmutableMap.copyOf(identifiers);
+		}
+
+		@Override
+		public String toString() {
+			return substitute(SqlNode::toString);
+		}
+
+		/** Returns the SQL string with identifiers replaced according to the
+		 * given unparse function. */
+		public String substitute(Function<SqlNode, String> fn) {
+			final SqlShuttle shuttle = new SqlShuttle() {
+				@Override
+				public SqlNode visit(SqlIdentifier id) {
+					if (id.isStar()) {
+						return id;
+					}
+					final SqlIdentifier toReplace = identifiersMap.get(id.getParserPosition());
+					if (toReplace != null && id.names.size() >= toReplace.names.size()) {

Review comment:
       Shouldn't this be rather:
   ```
   if (toReplace == null || id.names.size() >= toReplace.names.size()) {
   ```
   ?




----------------------------------------------------------------
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.

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



[GitHub] [flink] danny0405 edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   > Could you name a few of these breaking changes? I know about the dropped windows but what else?
   
   I listed some features i though important (very probably breaking) here:
   
   - [CALCITE-3786] The rel node digest was refactored
   - [CALCITE-3896 Top down trait pass through
   - [CALCITE-3916 Support cascades style top-down driven rule apply
   - [CALCITE-2569] UDFs that are table functions must implement SqlTableFunction and have CURSOR as their return type
   - [CALCITE-3923] Refactor how planner rules are parameterized
   
   But anyway, Calcite is a single open source community and we can not always depend on the version upgrade, and Calcite does not always evolve following Flink's request. If we have a simple workaround for a quick fix(log an issue there and remove the code when upgrade), it is better than just wait for the upgrade.
   
   This fix is critical, user can not even use the table function now in a `CREATE VIEW`.


----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 128e47f58b081d6273e3c6c57ad0da76c990595f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226) 
   * 6e9b5b711ca81e18366d521f564b9ed64113bf94 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0358a12e3524d251396cca950c7403eee205f0d6 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636) 
   * 870f73394bfc42e740891a6262e1bfd97efdba56 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752",
       "triggerID" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5766",
       "triggerID" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0aa2e599db47cf035f6d7cf0389e7caa273b5880",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0aa2e599db47cf035f6d7cf0389e7caa273b5880",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * efe2b4b092cbce31dee74b4261ca7a20904b2000 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5766) 
   * 0aa2e599db47cf035f6d7cf0389e7caa273b5880 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


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

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



[GitHub] [flink] danny0405 commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -70,30 +75,43 @@ public static Expander create(FlinkPlannerImpl planner) {
 	/** Expands identifiers in a given SQL string, returning a {@link Expanded}. */
 	public Expanded expanded(String ori) {
 		final Map<SqlParserPos, SqlIdentifier> identifiers = new HashMap<>();
+		final Map<String, SqlIdentifier> funcNameToId = new HashMap<>();

Review comment:
       Because the `BridgingSqlFunction` lost the parser position information.




----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c44b190d9e1350fa8853fe95b9f0284090f4d0fc Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273) 
   * bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6e9b5b711ca81e18366d521f564b9ed64113bf94 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228) 
   * 8559c87345749d7a627fd4ae4d4d58141a53639e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] twalthr commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   Merging hot fixes is fine with me as well. But we should have a strategy when and how such a hotfix will be removed from the Flink code base again.


----------------------------------------------------------------
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.

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



[GitHub] [flink] danny0405 commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {

Review comment:
       I'm afraid we never support expanding functions, i have added a test.




----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 44ba50fd578d65572ddfea8b09e0e001f9ea530b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601) 
   * 0358a12e3524d251396cca950c7403eee205f0d6 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586) 
   * 44ba50fd578d65572ddfea8b09e0e001f9ea530b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] dawidwys commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {

Review comment:
       The test you added uses a built-in function, which has a single part identifier which does not differ from not expanded one. Are you saying we never expanded identifiers for UDFs?




----------------------------------------------------------------
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.

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



[GitHub] [flink] wuchong commented on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   I'm fine with this hot fix. However, personally, I think we should catch up Calcite versions. Breaking changes and the upgrading effort is not a strong reason to stop us to upgrade. Otherwise,  the cost of upgrading will become greater and greater. 


----------------------------------------------------------------
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.

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



[GitHub] [flink] dawidwys commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -70,30 +75,43 @@ public static Expander create(FlinkPlannerImpl planner) {
 	/** Expands identifiers in a given SQL string, returning a {@link Expanded}. */
 	public Expanded expanded(String ori) {
 		final Map<SqlParserPos, SqlIdentifier> identifiers = new HashMap<>();
+		final Map<String, SqlIdentifier> funcNameToId = new HashMap<>();

Review comment:
       Why did you decide to use a different key for functions? Can't we use the `SqlParserPos` as well?




----------------------------------------------------------------
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.

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



[GitHub] [flink] danny0405 edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   > Could you name a few of these breaking changes? I know about the dropped windows but what else?
   
   I listed some features i though important (very probably breaking) here:
   
   - [CALCITE-3786] The rel node digest was refactored
   - [CALCITE-3896 Top down trait pass through
   - [CALCITE-3916 Support cascades style top-down driven rule apply
   - [CALCITE-2569] UDFs that are table functions must implement SqlTableFunction and have CURSOR as their return type
   - [CALCITE-3923] Refactor how planner rules are parameterized
   
   But anyway, Calcite is a single open source community and we can not always depend on the version upgrade, and Calcite does not always evolve following Flink's request. If we have a simple workaround for a quick fix(log an issue there and remove the code when upgrade), it is better than just wait for the upgrade.
   
   This fix is critical, user can not even use the table function now in a `CREATE VIEW` and is a blocker for VVP platform.


----------------------------------------------------------------
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.

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



[GitHub] [flink] dawidwys merged pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

Posted by GitBox <gi...@apache.org>.
dawidwys merged pull request #13050:
URL: https://github.com/apache/flink/pull/13050


   


----------------------------------------------------------------
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.

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



[GitHub] [flink] danny0405 commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -70,30 +75,43 @@ public static Expander create(FlinkPlannerImpl planner) {
 	/** Expands identifiers in a given SQL string, returning a {@link Expanded}. */
 	public Expanded expanded(String ori) {
 		final Map<SqlParserPos, SqlIdentifier> identifiers = new HashMap<>();
+		final Map<String, SqlIdentifier> funcNameToId = new HashMap<>();

Review comment:
       Because the `BridgingSqlFunction` lost the parser position information. We may need a refactor to `BridgingSqlFunction` but i don't want to in this PR.




----------------------------------------------------------------
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.

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



[GitHub] [flink] danny0405 commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/utils/Expander.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.utils;
+
+import org.apache.flink.table.planner.calcite.FlinkPlannerImpl;
+
+import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableMap;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.util.SqlBasicVisitor;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+
+/**
+ * Utility that expand SQL identifiers from a SQL query.
+ *
+ * <p>Simple use:
+ *
+ * <blockquote><code>
+ * final String sql =<br>
+ *     "select ename from emp where deptno &lt; 10";<br>
+ * final Expander.Expanded expanded =<br>
+ *     Expander.create(planner).expanded(sql);<br>
+ * print(expanded); // "select `emp`.`ename` from `catalog`.`db`.`emp` where `emp`.`deptno` &lt; 10"
+ * </code></blockquote>
+ *
+ * <p>Calling {@link Expanded#toString()} generates a string that is similar to
+ * SQL where a user has manually converted all identifiers as expanded, and
+ * which could then be persisted as expanded query of a Catalog view.
+ *
+ * <p>For more advanced formatting, use {@link Expanded#substitute(Function)}.
+ *
+ * <p>Adjust {@link SqlParser.Config} to use a different parser or parsing options.
+ */
+public class Expander {

Review comment:
       The first test also add a UDTF there and it still no expanded.
   
   I didn't find any evidence that Calcite validator expands the function IDs, the `DelegatingScope#fullyQualify` expands the table columns, the `IdentifierNamespace#validateImpl` expands the table name.
   
   Or did i miss something ?




----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 870f73394bfc42e740891a6262e1bfd97efdba56 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747) 
   * da58a528949de503a38c69aca6ea4d1e29b2beea UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] dawidwys commented on a change in pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/common/ViewsExpandingTest.scala
##########
@@ -20,9 +20,12 @@ package org.apache.flink.table.planner.plan.common
 
 import org.apache.flink.api.scala._
 import org.apache.flink.table.api._
-import org.apache.flink.table.catalog.{CatalogView, CatalogViewImpl, ObjectPath}
-import org.apache.flink.table.planner.utils.{TableTestBase, TableTestUtil, TableTestUtilBase}
+import org.apache.flink.table.catalog.{CatalogBaseTable, CatalogView, CatalogViewImpl, ObjectIdentifier, ObjectPath}
+import org.apache.flink.table.planner.runtime.stream.sql.FunctionITCase.PrimitiveScalarFunction

Review comment:
       Let's not import the `PrimitiveScalarFunction`. I don't think it makes sense to introduce a cross dependency between the tests. I think it is easy enough to add a simple function in this class.




----------------------------------------------------------------
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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752",
       "triggerID" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 870f73394bfc42e740891a6262e1bfd97efdba56 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747) 
   * da58a528949de503a38c69aca6ea4d1e29b2beea Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752",
       "triggerID" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5766",
       "triggerID" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da58a528949de503a38c69aca6ea4d1e29b2beea Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752) 
   * efe2b4b092cbce31dee74b4261ca7a20904b2000 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5766) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5636",
       "triggerID" : "0358a12e3524d251396cca950c7403eee205f0d6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5747",
       "triggerID" : "870f73394bfc42e740891a6262e1bfd97efdba56",
       "triggerType" : "PUSH"
     }, {
       "hash" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5752",
       "triggerID" : "da58a528949de503a38c69aca6ea4d1e29b2beea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5766",
       "triggerID" : "efe2b4b092cbce31dee74b4261ca7a20904b2000",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0aa2e599db47cf035f6d7cf0389e7caa273b5880",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5837",
       "triggerID" : "0aa2e599db47cf035f6d7cf0389e7caa273b5880",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * efe2b4b092cbce31dee74b4261ca7a20904b2000 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5766) 
   * 0aa2e599db47cf035f6d7cf0389e7caa273b5880 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5837) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5586",
       "triggerID" : "bba1b32fd9b7acb3e2ddc4678d4d26c835880e0b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601",
       "triggerID" : "44ba50fd578d65572ddfea8b09e0e001f9ea530b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 44ba50fd578d65572ddfea8b09e0e001f9ea530b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5601) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5115",
       "triggerID" : "1a2f39a71a931295f82a9bdbd36f2707f42298dd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5146",
       "triggerID" : "e274e166aed3ffacc4ac58409aaf3384c937cb66",
       "triggerType" : "PUSH"
     }, {
       "hash" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5226",
       "triggerID" : "128e47f58b081d6273e3c6c57ad0da76c990595f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5228",
       "triggerID" : "6e9b5b711ca81e18366d521f564b9ed64113bf94",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5235",
       "triggerID" : "8559c87345749d7a627fd4ae4d4d58141a53639e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273",
       "triggerID" : "c44b190d9e1350fa8853fe95b9f0284090f4d0fc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c44b190d9e1350fa8853fe95b9f0284090f4d0fc Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5273) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13050: [FLINK-18750][table] SqlValidatorException thrown when select from a …

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


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

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