You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "rewerma (via GitHub)" <gi...@apache.org> on 2023/04/03 15:36:39 UTC

[GitHub] [incubator-seatunnel] rewerma opened a new pull request, #4490: [Improve][Transform] Optimize SQL Transform package

rewerma opened a new pull request, #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490

   <!--
   
   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
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   Optimize SQL Transform package
   
   ## 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
   * [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update change log that in connector document. For more details you can refer to [connector-v2](https://github.com/apache/incubator-seatunnel/tree/dev/docs/en/connector-v2)
     2. Update [plugin-mapping.properties](https://github.com/apache/incubator-seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     3. Update the pom file of [seatunnel-dist](https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-dist/pom.xml)
   * [ ] Update the [`release-note`](https://github.com/apache/incubator-seatunnel/blob/dev/release-note.md).


-- 
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] rewerma commented on a diff in pull request #4490: [Improve][Transform] Optimize SQL Transform package and Fix Spark type conversion bug of transform

Posted by "rewerma (via GitHub)" <gi...@apache.org>.
rewerma commented on code in PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#discussion_r1174556245


##########
seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform.conf:
##########
@@ -31,8 +31,6 @@ source {
         id = "int"
         name = "string"
         age = "int"
-        c_map = "map<string, string>"
-        c_array = "array<int>"

Review Comment:
   It is unsupported for Spark engine transform yet



-- 
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] rewerma commented on pull request #4490: [Improve][Transform] Optimize SQL Transform package

Posted by "rewerma (via GitHub)" <gi...@apache.org>.
rewerma commented on PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#issuecomment-1504508382

   > Need to change title? Looks like other changes were made
   
   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.

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] hailin0 commented on a diff in pull request #4490: [Improve][Transform] Optimize SQL Transform package and Fix Spark type conversion bug of transform

Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#discussion_r1174554469


##########
seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform.conf:
##########
@@ -31,8 +31,6 @@ source {
         id = "int"
         name = "string"
         age = "int"
-        c_map = "map<string, string>"
-        c_array = "array<int>"

Review Comment:
   why delete?



-- 
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] rewerma commented on a diff in pull request #4490: [Improve][Transform] Optimize SQL Transform package and Fix Spark type conversion bug of transform

Posted by "rewerma (via GitHub)" <gi...@apache.org>.
rewerma commented on code in PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#discussion_r1174556245


##########
seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform.conf:
##########
@@ -31,8 +31,6 @@ source {
         id = "int"
         name = "string"
         age = "int"
-        c_map = "map<string, string>"
-        c_array = "array<int>"

Review Comment:
   It is unsupported for Spark engine transform  plugin yet



-- 
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] rewerma commented on a diff in pull request #4490: [Improve][Transform] Optimize SQL Transform package and Fix Spark type conversion bug of transform

Posted by "rewerma (via GitHub)" <gi...@apache.org>.
rewerma commented on code in PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#discussion_r1175191810


##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-3.3/src/main/java/org/apache/seatunnel/translation/spark/serialization/InternalRowConverter.java:
##########
@@ -241,4 +244,26 @@ private static Object reconvertArray(ArrayData arrayData, ArrayType<?, ?> arrayT
         }
         return newArray;
     }
+
+    public Object[] convertToFields(InternalRow internalRow, StructType structType) {

Review Comment:
   ok, I has fixed it



-- 
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] laglangyue commented on pull request #4490: [Improve][Transform] Optimize SQL Transform package and Fix Spark type conversion bug of transform

Posted by "laglangyue (via GitHub)" <gi...@apache.org>.
laglangyue commented on PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#issuecomment-1519090541

   In my opinion, use dataType of structType to convert data maybe not good. It cannot permanently solve the problem, or rather it is not very elegant. I think we should define serialization and deserialization objects based on the type of ST When we know an ST, we can clarify the various transformations of this row.
   
   what do you 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] hailin0 commented on pull request #4490: [Improve][Transform] Optimize SQL Transform package

Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#issuecomment-1502056752

   Need to change title? Looks like other changes were made


-- 
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] rewerma commented on a diff in pull request #4490: [Improve][Transform] Optimize SQL Transform package and Fix Spark type conversion bug of transform

Posted by "rewerma (via GitHub)" <gi...@apache.org>.
rewerma commented on code in PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#discussion_r1175191810


##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-3.3/src/main/java/org/apache/seatunnel/translation/spark/serialization/InternalRowConverter.java:
##########
@@ -241,4 +244,26 @@ private static Object reconvertArray(ArrayData arrayData, ArrayType<?, ?> arrayT
         }
         return newArray;
     }
+
+    public Object[] convertToFields(InternalRow internalRow, StructType structType) {

Review Comment:
   ok, I have fixed it



-- 
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] laglangyue commented on a diff in pull request #4490: [Improve][Transform] Optimize SQL Transform package and Fix Spark type conversion bug of transform

Posted by "laglangyue (via GitHub)" <gi...@apache.org>.
laglangyue commented on code in PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#discussion_r1174598742


##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-3.3/src/main/java/org/apache/seatunnel/translation/spark/serialization/InternalRowConverter.java:
##########
@@ -241,4 +244,26 @@ private static Object reconvertArray(ArrayData arrayData, ArrayType<?, ?> arrayT
         }
         return newArray;
     }
+
+    public Object[] convertToFields(InternalRow internalRow, StructType structType) {

Review Comment:
   if the method not support array or map, it will cause exception when handler array / map



-- 
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] laglangyue commented on a diff in pull request #4490: [Improve][Transform] Optimize SQL Transform package and Fix Spark type conversion bug of transform

Posted by "laglangyue (via GitHub)" <gi...@apache.org>.
laglangyue commented on code in PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490#discussion_r1174598906


##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-3.3/src/main/java/org/apache/seatunnel/translation/spark/serialization/InternalRowConverter.java:
##########
@@ -241,4 +244,26 @@ private static Object reconvertArray(ArrayData arrayData, ArrayType<?, ?> arrayT
         }
         return newArray;
     }
+
+    public Object[] convertToFields(InternalRow internalRow, StructType structType) {

Review Comment:
   For example when  I query a row from source, but I just want convert it's name it will exception;



##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-3.3/src/main/java/org/apache/seatunnel/translation/spark/serialization/InternalRowConverter.java:
##########
@@ -241,4 +244,26 @@ private static Object reconvertArray(ArrayData arrayData, ArrayType<?, ?> arrayT
         }
         return newArray;
     }
+
+    public Object[] convertToFields(InternalRow internalRow, StructType structType) {

Review Comment:
   For example, when  I query a row from source, but I just want convert it's name it will exception;



-- 
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] EricJoy2048 merged pull request #4490: [Improve][Transform] Optimize SQL Transform package and Fix Spark type conversion bug of transform

Posted by "EricJoy2048 (via GitHub)" <gi...@apache.org>.
EricJoy2048 merged PR #4490:
URL: https://github.com/apache/incubator-seatunnel/pull/4490


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