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/11/20 02:04:51 UTC

[GitHub] [spark] bersprockets commented on a diff in pull request #38727: [SPARK-41205][SQL] Check that format is foldable in `TryToBinary`

bersprockets commented on code in PR #38727:
URL: https://github.com/apache/spark/pull/38727#discussion_r1027172751


##########
sql/core/src/test/resources/sql-tests/inputs/try-string-functions.sql:
##########
@@ -45,4 +45,8 @@ select try_to_binary(null, null);
 select try_to_binary(null, cast(null as string));
 -- invalid format
 select try_to_binary('abc', 1);
-select try_to_binary('abc', 'invalidFormat');
\ No newline at end of file
+select try_to_binary('abc', 'invalidFormat');
+-- format must be foldable
+SELECT try_to_binary(col1, col2) from values ('abc', 'utf-8') as data(col1, col2);
+-- non-foldable input string
+SELECT try_to_binary(col1, 'utf-8') from values ('abc') as data(col1);

Review Comment:
   Not strictly relevant to this issue, but I noticed that there were no tests for non-foldable input values, so I added one.



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