You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/09/22 12:47:07 UTC

[GitHub] [incubator-seatunnel] hk-lrzy opened a new pull request, #2846: [SeaTunnel][Flink]fixed data stream transform to table not support BigDecimalTypeInfo

hk-lrzy opened a new pull request, #2846:
URL: https://github.com/apache/incubator-seatunnel/pull/2846

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   https://github.com/apache/incubator-seatunnel/issues/2816
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
   


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

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] hk-lrzy commented on a diff in pull request #2846: [SeaTunnel][Flink]fixed data stream transform to table not support BigDecimalTypeInfo

Posted by GitBox <gi...@apache.org>.
hk-lrzy commented on code in PR #2846:
URL: https://github.com/apache/incubator-seatunnel/pull/2846#discussion_r978286718


##########
seatunnel-translation/seatunnel-translation-flink/src/main/java/org/apache/seatunnel/translation/flink/utils/TypeConverterUtils.java:
##########
@@ -57,6 +59,7 @@ public class TypeConverterUtils {
         BRIDGED_TYPES.put(Float.class, BridgedType.of(BasicType.FLOAT_TYPE, BasicTypeInfo.FLOAT_TYPE_INFO));
         BRIDGED_TYPES.put(Double.class, BridgedType.of(BasicType.DOUBLE_TYPE, BasicTypeInfo.DOUBLE_TYPE_INFO));
         BRIDGED_TYPES.put(Void.class, BridgedType.of(BasicType.VOID_TYPE, BasicTypeInfo.VOID_TYPE_INFO));
+        BRIDGED_TYPES.put(BigDecimal.class, BridgedType.of(new DecimalType(38, 18), BasicTypeInfo.BIG_DEC_TYPE_INFO));

Review Comment:
   @ashulin  
   Correct, `TypeInfoDataTypeConverter` not support `BigDecimalTypeInfo` until now. https://issues.apache.org/jira/browse/FLINK-29373
   
   Another thing, the precision will not lose i think, i remember bigdecimal will auto detect the precision for the input value.



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

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] ashulin merged pull request #2846: [SeaTunnel][Flink]fixed data stream transform to table not support BigDecimalTypeInfo

Posted by GitBox <gi...@apache.org>.
ashulin merged PR #2846:
URL: https://github.com/apache/incubator-seatunnel/pull/2846


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

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] hk-lrzy commented on a diff in pull request #2846: [SeaTunnel][Flink]fixed data stream transform to table not support BigDecimalTypeInfo

Posted by GitBox <gi...@apache.org>.
hk-lrzy commented on code in PR #2846:
URL: https://github.com/apache/incubator-seatunnel/pull/2846#discussion_r978286718


##########
seatunnel-translation/seatunnel-translation-flink/src/main/java/org/apache/seatunnel/translation/flink/utils/TypeConverterUtils.java:
##########
@@ -57,6 +59,7 @@ public class TypeConverterUtils {
         BRIDGED_TYPES.put(Float.class, BridgedType.of(BasicType.FLOAT_TYPE, BasicTypeInfo.FLOAT_TYPE_INFO));
         BRIDGED_TYPES.put(Double.class, BridgedType.of(BasicType.DOUBLE_TYPE, BasicTypeInfo.DOUBLE_TYPE_INFO));
         BRIDGED_TYPES.put(Void.class, BridgedType.of(BasicType.VOID_TYPE, BasicTypeInfo.VOID_TYPE_INFO));
+        BRIDGED_TYPES.put(BigDecimal.class, BridgedType.of(new DecimalType(38, 18), BasicTypeInfo.BIG_DEC_TYPE_INFO));

Review Comment:
   @ashulin  
   Correct, `TypeInfoDataTypeConverter` not support `BigDecimalTypeInfo` until now. https://issues.apache.org/jira/browse/FLINK-29373
   
   Another thing, the precision will not lose i think.



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

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] ashulin commented on a diff in pull request #2846: [SeaTunnel][Flink]fixed data stream transform to table not support BigDecimalTypeInfo

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2846:
URL: https://github.com/apache/incubator-seatunnel/pull/2846#discussion_r978281405


##########
seatunnel-translation/seatunnel-translation-flink/src/main/java/org/apache/seatunnel/translation/flink/utils/TypeConverterUtils.java:
##########
@@ -57,6 +59,7 @@ public class TypeConverterUtils {
         BRIDGED_TYPES.put(Float.class, BridgedType.of(BasicType.FLOAT_TYPE, BasicTypeInfo.FLOAT_TYPE_INFO));
         BRIDGED_TYPES.put(Double.class, BridgedType.of(BasicType.DOUBLE_TYPE, BasicTypeInfo.DOUBLE_TYPE_INFO));
         BRIDGED_TYPES.put(Void.class, BridgedType.of(BasicType.VOID_TYPE, BasicTypeInfo.VOID_TYPE_INFO));
+        BRIDGED_TYPES.put(BigDecimal.class, BridgedType.of(new DecimalType(38, 18), BasicTypeInfo.BIG_DEC_TYPE_INFO));

Review Comment:
   This will lead to loss of precision. I checked the flink code and found that flink's TypeInfoDataTypeConverter does not handle BigDecimalTypeInfo



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

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] hk-lrzy commented on a diff in pull request #2846: [SeaTunnel][Flink]fixed data stream transform to table not support BigDecimalTypeInfo

Posted by GitBox <gi...@apache.org>.
hk-lrzy commented on code in PR #2846:
URL: https://github.com/apache/incubator-seatunnel/pull/2846#discussion_r978286718


##########
seatunnel-translation/seatunnel-translation-flink/src/main/java/org/apache/seatunnel/translation/flink/utils/TypeConverterUtils.java:
##########
@@ -57,6 +59,7 @@ public class TypeConverterUtils {
         BRIDGED_TYPES.put(Float.class, BridgedType.of(BasicType.FLOAT_TYPE, BasicTypeInfo.FLOAT_TYPE_INFO));
         BRIDGED_TYPES.put(Double.class, BridgedType.of(BasicType.DOUBLE_TYPE, BasicTypeInfo.DOUBLE_TYPE_INFO));
         BRIDGED_TYPES.put(Void.class, BridgedType.of(BasicType.VOID_TYPE, BasicTypeInfo.VOID_TYPE_INFO));
+        BRIDGED_TYPES.put(BigDecimal.class, BridgedType.of(new DecimalType(38, 18), BasicTypeInfo.BIG_DEC_TYPE_INFO));

Review Comment:
   @ashulin  
   Correct, `TypeInfoDataTypeConverter` not support `BigDecimalTypeInfo` until now. https://issues.apache.org/jira/browse/FLINK-29373
   
   Another thing, the precision will not lose i think, i remember bigdecimal will auto detect the precision for the input value, and maybe we can check the code `BigDecSerializer` 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.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] hk-lrzy commented on a diff in pull request #2846: [SeaTunnel][Flink]fixed data stream transform to table not support BigDecimalTypeInfo

Posted by GitBox <gi...@apache.org>.
hk-lrzy commented on code in PR #2846:
URL: https://github.com/apache/incubator-seatunnel/pull/2846#discussion_r978286718


##########
seatunnel-translation/seatunnel-translation-flink/src/main/java/org/apache/seatunnel/translation/flink/utils/TypeConverterUtils.java:
##########
@@ -57,6 +59,7 @@ public class TypeConverterUtils {
         BRIDGED_TYPES.put(Float.class, BridgedType.of(BasicType.FLOAT_TYPE, BasicTypeInfo.FLOAT_TYPE_INFO));
         BRIDGED_TYPES.put(Double.class, BridgedType.of(BasicType.DOUBLE_TYPE, BasicTypeInfo.DOUBLE_TYPE_INFO));
         BRIDGED_TYPES.put(Void.class, BridgedType.of(BasicType.VOID_TYPE, BasicTypeInfo.VOID_TYPE_INFO));
+        BRIDGED_TYPES.put(BigDecimal.class, BridgedType.of(new DecimalType(38, 18), BasicTypeInfo.BIG_DEC_TYPE_INFO));

Review Comment:
   @ashulin  
   Right `TypeInfoDataTypeConverter` not support `BigDecimalTypeInfo` until now. https://issues.apache.org/jira/browse/FLINK-29373
   
   Another thing, the precision will not lose i think.



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

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

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