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/02/10 10:39:18 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #35415: [SPARK-37507][SQL] Add a new SQL function to_binary

HyukjinKwon commented on a change in pull request #35415:
URL: https://github.com/apache/spark/pull/35415#discussion_r803532334



##########
File path: sql/core/src/test/resources/sql-tests/results/ansi/string-functions.sql.out
##########
@@ -824,3 +824,84 @@ select to_number('00,454.8-', '00,000.9-')
 struct<to_number(00,454.8-, 00,000.9-):decimal(6,1)>
 -- !query output
 -454.8
+
+
+-- !query
+select to_binary('abc')
+-- !query schema
+struct<to_binary(abc):binary>
+-- !query output
+�
+
+
+-- !query
+select to_binary('abc', 'utf-8')
+-- !query schema
+struct<to_binary(abc, utf-8):binary>
+-- !query output
+abc
+
+
+-- !query
+select to_binary('abc', 'base64')
+-- !query schema
+struct<to_binary(abc, base64):binary>
+-- !query output
+i�
+
+
+-- !query
+select to_binary('abc', 'base2')
+-- !query schema
+struct<to_binary(abc, base2):binary>
+-- !query output
+abc
+
+
+-- !query
+select to_binary('abc', 'hex')
+-- !query schema
+struct<to_binary(abc, hex):binary>
+-- !query output
+�
+
+
+-- !query
+select to_binary('abc', concat('utf', '-8'))
+-- !query schema
+struct<to_binary(abc, concat(utf, -8)):binary>
+-- !query output
+abc
+
+
+-- !query
+select to_binary('abc', concat('base', '64'))
+-- !query schema
+struct<to_binary(abc, concat(base, 64)):binary>
+-- !query output
+i�
+
+
+-- !query
+select to_binary('abc', 'Hex')
+-- !query schema
+struct<to_binary(abc, Hex):binary>
+-- !query output
+�
+
+
+-- !query
+select to_binary('abc', 'UTF-8')
+-- !query schema
+struct<to_binary(abc, UTF-8):binary>
+-- !query output
+abc
+
+
+-- !query
+select to_binary('abc', null)
+-- !query schema
+struct<>
+-- !query output
+java.lang.RuntimeException
+After applying rule org.apache.spark.sql.catalyst.optimizer.ReplaceExpressions in batch Finish Analysis, the structural integrity of the plan is broken.

Review comment:
       Seems like something went wrong in this case.




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