You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/05 19:40:47 UTC

[GitHub] [spark] xinrong-meng opened a new pull request, #38921: [WIP] Implement String/Binary functions

xinrong-meng opened a new pull request, #38921:
URL: https://github.com/apache/spark/pull/38921

   
   ### What changes were proposed in this pull request?
   
   
   
   ### Why are the changes needed?
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   
   ### How was this patch tested?
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] amaliujia commented on a diff in pull request #38921: [SPARK-41397][CONNECT][PYTHON] Implement part of string/binary functions

Posted by GitBox <gi...@apache.org>.
amaliujia commented on code in PR #38921:
URL: https://github.com/apache/spark/pull/38921#discussion_r1041309241


##########
python/pyspark/sql/tests/connect/test_connect_function.py:
##########
@@ -410,6 +410,67 @@ def test_aggregation_functions(self):
             sdf.groupBy("a").agg(SF.percentile_approx(sdf.b, [0.1, 0.9])).toPandas(),
         )
 
+    def test_string_functions(self):
+        from pyspark.sql import functions as SF
+        from pyspark.sql.connect import functions as CF
+
+        query = """
+            SELECT * FROM VALUES
+            ('   ab   ', 'ab   ', NULL), ('   ab', NULL, 'ab')
+            AS tab(a, b, c)
+            """
+        # +--------+-----+----+
+        # |       a|    b|   c|
+        # +--------+-----+----+
+        # |   ab   |ab   |null|
+        # |      ab| null|  ab|
+        # +--------+-----+----+

Review Comment:
   Thanks for creating this format of example!



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] xinrong-meng commented on a diff in pull request #38921: [SPARK-41397][CONNECT][PYTHON] Implement part of string/binary functions

Posted by GitBox <gi...@apache.org>.
xinrong-meng commented on code in PR #38921:
URL: https://github.com/apache/spark/pull/38921#discussion_r1040281681


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:
##########
@@ -44,16 +44,16 @@ import org.apache.spark.unsafe.types.{ByteArray, UTF8String}
 // This file defines expressions for string operations.
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 
-

Review Comment:
   Thanks!



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #38921: [SPARK-41397][CONNECT][PYTHON] Implement part of string/binary functions

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #38921:
URL: https://github.com/apache/spark/pull/38921#issuecomment-1340888030

   Can one of the admins verify this patch?


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zhengruifeng closed pull request #38921: [SPARK-41397][CONNECT][PYTHON] Implement part of string/binary functions

Posted by GitBox <gi...@apache.org>.
zhengruifeng closed pull request #38921: [SPARK-41397][CONNECT][PYTHON] Implement part of string/binary functions
URL: https://github.com/apache/spark/pull/38921


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zhengruifeng commented on a diff in pull request #38921: [SPARK-41397][CONNECT][PYTHON] Implement part of string/binary functions

Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on code in PR #38921:
URL: https://github.com/apache/spark/pull/38921#discussion_r1040278329


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:
##########
@@ -44,16 +44,16 @@ import org.apache.spark.unsafe.types.{ByteArray, UTF8String}
 // This file defines expressions for string operations.
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 
-

Review Comment:
   I think we need to revert the changes in this file?



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zhengruifeng commented on pull request #38921: [SPARK-41397][CONNECT][PYTHON] Implement part of string/binary functions

Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on PR #38921:
URL: https://github.com/apache/spark/pull/38921#issuecomment-1340345754

   merged into master


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] xinrong-meng commented on pull request #38921: [SPARK-41397][CONNECT][PYTHON] Implement part of string/binary functions

Posted by GitBox <gi...@apache.org>.
xinrong-meng commented on PR #38921:
URL: https://github.com/apache/spark/pull/38921#issuecomment-1339719745

   @amaliujia @HyukjinKwon @grundprinzip Would you please review? Thanks!


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] xinrong-meng commented on a diff in pull request #38921: [SPARK-41397][CONNECT][PYTHON] Implement part of string/binary functions

Posted by GitBox <gi...@apache.org>.
xinrong-meng commented on code in PR #38921:
URL: https://github.com/apache/spark/pull/38921#discussion_r1041642310


##########
python/pyspark/sql/tests/connect/test_connect_function.py:
##########
@@ -410,6 +410,67 @@ def test_aggregation_functions(self):
             sdf.groupBy("a").agg(SF.percentile_approx(sdf.b, [0.1, 0.9])).toPandas(),
         )
 
+    def test_string_functions(self):
+        from pyspark.sql import functions as SF
+        from pyspark.sql.connect import functions as CF
+
+        query = """
+            SELECT * FROM VALUES
+            ('   ab   ', 'ab   ', NULL), ('   ab', NULL, 'ab')
+            AS tab(a, b, c)
+            """
+        # +--------+-----+----+
+        # |       a|    b|   c|
+        # +--------+-----+----+
+        # |   ab   |ab   |null|
+        # |      ab| null|  ab|
+        # +--------+-----+----+

Review Comment:
   Thanks!



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org