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/04/22 03:37:35 UTC

[GitHub] [flink] zjuwangg opened a new pull request #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/timestamp/varchar

zjuwangg opened a new pull request #11848:
URL: https://github.com/apache/flink/pull/11848


   ## What is the purpose of the change
   
   * Now TypeMappingUtils#checkPhysicalLogicalTypeCompatible method doesn't consider the different physical and logical type validation logic of source and sink: logical type should be able to cover the physical type in source, but physical type should be able to cover the logic type in sink vice verse. Besides, the decimal type should be taken more carefully, when target type is Legacy(Decimal), it should be able to accept any precision decimal type.*
   * This pr aims to solve the above problem.*
   
   
   ## Brief change log
   
     - 9b24a40 correct the validation logc
   
   ## Verifying this change
   This change is a trivial rework / code cleanup without any test coverage.
   
   ## 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 edited a comment on issue #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/timestamp/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b24a40f43a101b63ab73d1fa1e0c0f31178b36d Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/161363103) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22) 
   
   <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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161787406",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b24a40f43a101b63ab73d1fa1e0c0f31178b36d Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/161363103) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22) 
   * 88d8d3f5e30e69f324adac96e4db471f91fe490b Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161787406) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180) 
   * 7357ae7ca4a8a752458b1ed3b6391c846ff6bd09 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] zjuwangg commented on a change in pull request #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TypeMappingUtils.java
##########
@@ -169,8 +169,7 @@ public static void checkPhysicalLogicalTypeCompatible(
 										logicalFieldName,
 										physicalFieldType,
 										physicalFieldName,
-										"TableSource return type"),
-								cause));
+										"TableSource return type"), cause));

Review comment:
       Oh, sry, you are right. 




----------------------------------------------------------------
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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TypeMappingUtils.java
##########
@@ -169,8 +169,7 @@ public static void checkPhysicalLogicalTypeCompatible(
 										logicalFieldName,
 										physicalFieldType,
 										physicalFieldName,
-										"TableSource return type"),
-								cause));
+										"TableSource return type"), cause));

Review comment:
       What I meant is that we can inline the `TableSource return type` into the string. There is no reason for having it as an argument to `String.format()`.:
   ```
   (cause) -> new ValidationException(
   	String.format("Type %s of table field '%s' does not match with " +
   		"the physical type %s of the '%s' field of the TableSource return type.",
   			logicalFieldType,
   			logicalFieldName,
   			physicalFieldType,
   			physicalFieldName),
   	cause));
   ```




----------------------------------------------------------------
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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   I will review it today.


----------------------------------------------------------------
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] zjuwangg commented on pull request #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   > Thank you for the update. Merged.
   
   Thanks your review and merge 🌹 @dawidwys 


----------------------------------------------------------------
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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161787406",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161808435",
       "triggerID" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=195",
       "triggerID" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 88d8d3f5e30e69f324adac96e4db471f91fe490b Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/161787406) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180) 
   * 7357ae7ca4a8a752458b1ed3b6391c846ff6bd09 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161808435) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=195) 
   
   <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 issue #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/timestamp/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b24a40f43a101b63ab73d1fa1e0c0f31178b36d Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/161363103) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22) 
   
   <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 issue #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/timestamp/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b24a40f43a101b63ab73d1fa1e0c0f31178b36d 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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/timestamp/varchar

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



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TypeMappingUtils.java
##########
@@ -158,19 +158,33 @@ public static void checkPhysicalLogicalTypeCompatible(
 			String physicalFieldName,
 			String logicalFieldName,
 			boolean isSource) {
-		checkIfCompatible(
-			physicalFieldType,
-			logicalFieldType,
-			(cause) -> new ValidationException(
-				String.format(
-					"Type %s of table field '%s' does not match with " +
-						"the physical type %s of the '%s' field of the %s.",
+		if (isSource) {
+			checkIfCompatible(
+					physicalFieldType,
+					logicalFieldType,
+					(cause) -> new ValidationException(
+								String.format("Type %s of table field '%s' does not match with " +
+									"the physical type %s of the '%s' field of the %s.",
+										logicalFieldType,
+										logicalFieldName,
+										physicalFieldType,
+										physicalFieldName,
+										"TableSource return type"),

Review comment:
       Lets just inline the last argument.




----------------------------------------------------------------
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] zjuwangg commented on issue #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/timestamp/varchar

Posted by GitBox <gi...@apache.org>.
zjuwangg commented on issue #11848:
URL: https://github.com/apache/flink/pull/11848#issuecomment-618404154


   Thanks for your detailed review @dawidwys 
   I'll address your comments and add tests soon.


----------------------------------------------------------------
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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161787406",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b24a40f43a101b63ab73d1fa1e0c0f31178b36d Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/161363103) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22) 
   * 88d8d3f5e30e69f324adac96e4db471f91fe490b Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161787406) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180) 
   
   <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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TypeMappingUtils.java
##########
@@ -169,8 +169,7 @@ public static void checkPhysicalLogicalTypeCompatible(
 										logicalFieldName,
 										physicalFieldType,
 										physicalFieldName,
-										"TableSource return type"),
-								cause));
+										"TableSource return type"), cause));

Review comment:
       What I meant is that we can inline the `TableSource return type` into the string. There is no reason for having it as an argument to `String.format()`.:
   ```
   (cause) -> new ValidationException(
   		String.format("Type %s of table field '%s' does not match with " +
   			"the physical type %s of the '%s' field of the TableSource return type.",
   				logicalFieldType,
   				logicalFieldName,
   				physicalFieldType,
   				physicalFieldName),
   		cause));
   ```




----------------------------------------------------------------
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 issue #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/timestamp/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b24a40f43a101b63ab73d1fa1e0c0f31178b36d Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161363103) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22) 
   
   <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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TypeMappingUtils.java
##########
@@ -169,8 +169,7 @@ public static void checkPhysicalLogicalTypeCompatible(
 										logicalFieldName,
 										physicalFieldType,
 										physicalFieldName,
-										"TableSource return type"),
-								cause));
+										"TableSource return type"), cause));

Review comment:
       What I meant is that we can inline the `TableSource return type` into the string. There is no reason for having it as an argument to `String.format()`.:
   ```
   (cause) -> new ValidationException(
   				String.format("Type %s of table field '%s' does not match with " +
   					"the physical type %s of the '%s' field of the "TableSource return type".",
   						logicalFieldType,
   						logicalFieldName,
   						physicalFieldType,
   						physicalFieldName),
   				cause));
   ```

##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TypeMappingUtils.java
##########
@@ -169,8 +169,7 @@ public static void checkPhysicalLogicalTypeCompatible(
 										logicalFieldName,
 										physicalFieldType,
 										physicalFieldName,
-										"TableSource return type"),
-								cause));
+										"TableSource return type"), cause));

Review comment:
       What I meant is that we can inline the `TableSource return type` into the string. There is no reason for having it as an argument to `String.format()`.:
   ```
   (cause) -> new ValidationException(
   				String.format("Type %s of table field '%s' does not match with " +
   					"the physical type %s of the '%s' field of the TableSource return type.",
   						logicalFieldType,
   						logicalFieldName,
   						physicalFieldType,
   						physicalFieldName),
   				cause));
   ```




----------------------------------------------------------------
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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161787406",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161808435",
       "triggerID" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=195",
       "triggerID" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7357ae7ca4a8a752458b1ed3b6391c846ff6bd09 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161808435) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=195) 
   
   <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 issue #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/timestamp/varchar

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


   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 9b24a40f43a101b63ab73d1fa1e0c0f31178b36d (Wed Apr 22 03:39:45 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-17313).** 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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161787406",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161808435",
       "triggerID" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=195",
       "triggerID" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 88d8d3f5e30e69f324adac96e4db471f91fe490b Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/161787406) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180) 
   * 7357ae7ca4a8a752458b1ed3b6391c846ff6bd09 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161808435) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=195) 
   
   <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] zjuwangg commented on a change in pull request #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/timestamp/varchar

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



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TypeMappingUtils.java
##########
@@ -158,19 +158,33 @@ public static void checkPhysicalLogicalTypeCompatible(
 			String physicalFieldName,
 			String logicalFieldName,
 			boolean isSource) {
-		checkIfCompatible(
-			physicalFieldType,
-			logicalFieldType,
-			(cause) -> new ValidationException(
-				String.format(
-					"Type %s of table field '%s' does not match with " +
-						"the physical type %s of the '%s' field of the %s.",
+		if (isSource) {
+			checkIfCompatible(
+					physicalFieldType,
+					logicalFieldType,
+					(cause) -> new ValidationException(
+								String.format("Type %s of table field '%s' does not match with " +
+									"the physical type %s of the '%s' field of the %s.",
+										logicalFieldType,
+										logicalFieldName,
+										physicalFieldType,
+										physicalFieldName,
+										"TableSource return type"),

Review comment:
       ok




----------------------------------------------------------------
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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TypeMappingUtils.java
##########
@@ -169,8 +169,7 @@ public static void checkPhysicalLogicalTypeCompatible(
 										logicalFieldName,
 										physicalFieldType,
 										physicalFieldName,
-										"TableSource return type"),
-								cause));
+										"TableSource return type"), cause));

Review comment:
       What I meant is that we can inline the `TableSource return type` into the string. There is no reason for having it as an argument to `String.format()`.:
   ```
   (cause) -> new ValidationException(
   						String.format("Type %s of table field '%s' does not match with " +
   							"the physical type %s of the '%s' field of the "TableSource return type".",
   								logicalFieldType,
   								logicalFieldName,
   								physicalFieldType,
   								physicalFieldName),
   						cause));
   ```




----------------------------------------------------------------
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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=180",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161787406",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161808435",
       "triggerID" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=195",
       "triggerID" : "7357ae7ca4a8a752458b1ed3b6391c846ff6bd09",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7357ae7ca4a8a752458b1ed3b6391c846ff6bd09 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/161808435) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=195) 
   
   <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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161363103",
       "triggerID" : "9b24a40f43a101b63ab73d1fa1e0c0f31178b36d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "88d8d3f5e30e69f324adac96e4db471f91fe490b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b24a40f43a101b63ab73d1fa1e0c0f31178b36d Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/161363103) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=22) 
   * 88d8d3f5e30e69f324adac96e4db471f91fe490b 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 #11848: [FLINK-17313]fix type validation error when sink table ddl exists column with precision of decimal/varchar

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


   Thank you for the update. Merged.


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

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