gengliangwang commented on a change in pull request #34681:
URL: https://github.com/apache/spark/pull/34681#discussion_r754303746



##########
File path: 
sql/core/src/test/resources/sql-tests/results/ansi/string-functions.sql.out
##########
@@ -545,37 +539,33 @@ AABB
 -- !query
 SELECT lpad('abc', 5, x'57')
 -- !query schema
-struct<>
+struct<lpad(abc, 5, X'57'):string>
 -- !query output
-org.apache.spark.sql.AnalysisException
-cannot resolve 'lpad('abc', 5, X'57')' due to data type mismatch: argument 3 
requires string type, however, 'X'57'' is of binary type.; line 1 pos 7
+WWabc
 
 
 -- !query
 SELECT lpad(x'57', 5, 'abc')
 -- !query schema
-struct<>
+struct<lpad(X'57', 5, abc):string>
 -- !query output
-org.apache.spark.sql.AnalysisException
-cannot resolve 'lpad(X'57', 5, 'abc')' due to data type mismatch: argument 1 
requires string type, however, 'X'57'' is of binary type.; line 1 pos 7
+abcaW
 
 
 -- !query
 SELECT rpad('abc', 5, x'57')
 -- !query schema
-struct<>
+struct<rpad(abc, 5, X'57'):string>
 -- !query output
-org.apache.spark.sql.AnalysisException
-cannot resolve 'rpad('abc', 5, X'57')' due to data type mismatch: argument 3 
requires string type, however, 'X'57'' is of binary type.; line 1 pos 7
+abcWW
 
 
 -- !query
 SELECT rpad(x'57', 5, 'abc')
 -- !query schema
-struct<>
+struct<rpad(X'57', 5, abc):string>
 -- !query output
-org.apache.spark.sql.AnalysisException
-cannot resolve 'rpad(X'57', 5, 'abc')' due to data type mismatch: argument 1 
requires string type, however, 'X'57'' is of binary type.; line 1 pos 7
+Wabca
 
 

Review comment:
       Yes, there are exceptions in the ansi one:
   ```
   > ... left("abcd", 'a') 
   java.lang.NumberFormatException
   invalid input syntax for type numeric: a
   ```




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to