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/07/22 10:43:04 UTC

[GitHub] [flink] twalthr opened a new pull request #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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


   ## What is the purpose of the change
   
   Extracts the argument types early in order to perform the validation based on `AggregateInfo`. The validation is the same for all kind of UDFs.
   
   ## Brief change log
   
   - Updates validation for all kinds of UDFs
   
   ## Verifying this change
   
   This change is already covered by existing tests.
   
   ## 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] flinkbot commented on pull request #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "527901b187b81ca658722f8cf9733b0d1ac158be",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "527901b187b81ca658722f8cf9733b0d1ac158be",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 527901b187b81ca658722f8cf9733b0d1ac158be 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 #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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


   Thanks for the review @aljoscha. Your change summary is correct. The changes around `GenericRowData` are necessary because `GenericRowData` is not an official conversion class for the ROW type. It must be `RowData`. It is dangerous to make implicit assumptions how the `RowData` is implemented. I didn't want to change the existing functions too much. So I decided to fix the tests the way it is 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] twalthr commented on a change in pull request #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/UserDefinedFunctionHelper.java
##########
@@ -215,6 +216,38 @@ public static void validateClass(Class<? extends UserDefinedFunction> functionCl
 		validateClass(functionClass, true);
 	}
 
+	/**
+	 * Validates a {@link UserDefinedFunction} class for usage in the runtime.
+	 *
+	 * <p>Note: This is for the final validation when actual {@link DataType}s for arguments and result

Review comment:
       thanks for the hint, actually I'm aware of this trick. but I find this one more readable in the code.




----------------------------------------------------------------
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 #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "527901b187b81ca658722f8cf9733b0d1ac158be",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4726",
       "triggerID" : "527901b187b81ca658722f8cf9733b0d1ac158be",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 527901b187b81ca658722f8cf9733b0d1ac158be Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4726) 
   
   <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 closed pull request #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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


   


----------------------------------------------------------------
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 #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/UserDefinedFunctionHelper.java
##########
@@ -215,6 +216,38 @@ public static void validateClass(Class<? extends UserDefinedFunction> functionCl
 		validateClass(functionClass, true);
 	}
 
+	/**
+	 * Validates a {@link UserDefinedFunction} class for usage in the runtime.
+	 *
+	 * <p>Note: This is for the final validation when actual {@link DataType}s for arguments and result

Review comment:
       just a nitpick but you can write `{@link DataType DataTypes}`, then it will link to `DataType` but the link will be called `DataTypes`.

##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdHandlerTestBase.scala
##########
@@ -749,7 +749,7 @@ class FlinkRelMdHandlerTestBase {
       false,
       false,
       false,
-      Seq(Integer.valueOf(0)).toList,
+      Seq(Integer.valueOf(3)).toList,

Review comment:
       What's going on here? 




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

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



[GitHub] [flink] twalthr commented on a change in pull request #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdHandlerTestBase.scala
##########
@@ -749,7 +749,7 @@ class FlinkRelMdHandlerTestBase {
       false,
       false,
       false,
-      Seq(Integer.valueOf(0)).toList,
+      Seq(Integer.valueOf(3)).toList,

Review comment:
       I think this test was not implemented correctly. I got a type mismatch here. The purpose of this test is about propagating metadata, so the change should not affect the test negatively.




----------------------------------------------------------------
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 #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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


   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 527901b187b81ca658722f8cf9733b0d1ac158be (Wed Jul 22 10:45:47 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 #12959: [FLINK-15803][table] Unify validation for all kinds of UDFs

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "527901b187b81ca658722f8cf9733b0d1ac158be",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4726",
       "triggerID" : "527901b187b81ca658722f8cf9733b0d1ac158be",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 527901b187b81ca658722f8cf9733b0d1ac158be Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=4726) 
   
   <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