wangyum opened a new pull request #24859: [SPARK-28033][SQL] String 
concatenation low priority than other arithmeticBinary
URL: https://github.com/apache/spark/pull/24859
 
 
   ## What changes were proposed in this pull request?
   
   This pr make string concatenation(`'||'`) low priority than other operators, 
for example:
   ```sql
   spark-sql> select 'four: ' || 2 + 2;
   NULL
   spark-sql> select 'zero: ' || 2 ^ 2;
   Error in query: cannot resolve '(CAST(concat('zero: ', CAST(2 AS STRING)) AS 
DOUBLE) ^ 2)' due to data type mismatch: differing types in 
'(CAST(concat('zero: ', CAST(2 AS STRING)) AS DOUBLE) ^ 2)' (double and int).; 
line 1 pos 7;
   'Project [unresolvedalias((cast(concat(zero: , cast(2 as string)) as double) 
^ 2), None)]
   +- OneRowRelation
   ```
   
   ```sql
   hive> select 'four: ' || 2 + 2;
   OK
   four: 4
   Time taken: 1.774 seconds, Fetched: 1 row(s)
   hive> select 'zero: ' || 2 ^ 2;
   OK
   zero: 0
   Time taken: 1.651 seconds, Fetched: 1 row(s)
   ```
   
   ## How was this patch tested?
   
   unit tests

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to