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/31 12:03:15 UTC

[GitHub] [flink] twalthr opened a new pull request #13285: [FLINK-19049][table] Fix validation of table functions in projections

twalthr opened a new pull request #13285:
URL: https://github.com/apache/flink/pull/13285


   ## What is the purpose of the change
   
   Validates that table functions cannot be used at locations of scalar functions.
   
   ## Brief change log
   
   Update validation in both `CorrelateCodeGenerator` and `CalcCodeGenerator`.
   
   ## Verifying this change
   
   This change is already covered by existing tests, such as `FunctionITCase`.
   
   ## 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
     - If yes, how is the feature documented? not applicable
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



[GitHub] [flink] twalthr closed pull request #13285: [FLINK-19049][table] Fix validation of table functions in projections

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


   


----------------------------------------------------------------
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] aljoscha commented on a change in pull request #13285: [FLINK-19049][table] Fix validation of table functions in projections

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



##########
File path: flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/runtime/stream/sql/FunctionITCase.java
##########
@@ -869,12 +869,19 @@ public void testInvalidUseOfTableFunction() {
 		tEnv().executeSql("CREATE TABLE SinkTable(s ROW<s STRING, sa ARRAY<STRING> NOT NULL>) WITH ('connector' = 'COLLECTION')");
 
 		tEnv().createTemporarySystemFunction("RowTableFunction", RowTableFunction.class);
-		tEnv().executeSql(
-			"INSERT INTO SinkTable " +
-			"SELECT RowTableFunction('test')");
 
-		// currently, calling a table function like a scalar function produces no result
-		assertThat(TestCollectionTableFactory.getResult(), equalTo(Collections.emptyList()));
+		try {
+			tEnv().explainSql(
+				"INSERT INTO SinkTable " +
+				"SELECT RowTableFunction('test')");
+			fail();
+		} catch (ValidationException e) {
+			assertThat(
+				e,
+				hasMessage(

Review comment:
       Nice use of matchers!




----------------------------------------------------------------
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 #13285: [FLINK-19049][table] Fix validation of table functions in projections

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


   The old exception was a runtime `NullPointerException` that is not covered by just running `execute()` without waiting for job completion. This was a mistake in the test. With this PR we can produce an exception in pre-flight phase. So calling `execInsertSqlAndWaitResult` is not necessary anymore as we fail earlier. Btw we will have a better API for waiting shortly. I reviewed it yesterday: https://github.com/apache/flink/pull/12688


----------------------------------------------------------------
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 #13285: [FLINK-19049][table] Fix validation of table functions in projections

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


   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 402986db7607026718d88e0651e0e9baf16d7e76 (Mon Aug 31 12:05:43 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13285: [FLINK-19049][table] Fix validation of table functions in projections

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "402986db7607026718d88e0651e0e9baf16d7e76",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6013",
       "triggerID" : "402986db7607026718d88e0651e0e9baf16d7e76",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 402986db7607026718d88e0651e0e9baf16d7e76 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6013) 
   
   <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] aljoscha commented on pull request #13285: [FLINK-19049][table] Fix validation of table functions in projections

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


   Perfect! This is good to go 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] flinkbot edited a comment on pull request #13285: [FLINK-19049][table] Fix validation of table functions in projections

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "402986db7607026718d88e0651e0e9baf16d7e76",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6013",
       "triggerID" : "402986db7607026718d88e0651e0e9baf16d7e76",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 402986db7607026718d88e0651e0e9baf16d7e76 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6013) 
   
   <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 #13285: [FLINK-19049][table] Fix validation of table functions in projections

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "402986db7607026718d88e0651e0e9baf16d7e76",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "402986db7607026718d88e0651e0e9baf16d7e76",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 402986db7607026718d88e0651e0e9baf16d7e76 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