wangyum edited a comment on issue #24859: [SPARK-28033][SQL] String 
concatenation should lower precedence than other operators
URL: https://github.com/apache/spark/pull/24859#issuecomment-504713339
 
 
   It seems that it works only when the other side is a number string or a 
space:
   ```sql
   SQL> select banner from v$version;
   
   BANNER
   
--------------------------------------------------------------------------------
   Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
   PL/SQL Release 12.2.0.1.0 - Production
   CORE 12.2.0.1.0      Production
   TNS for Linux: Version 12.2.0.1.0 - Production
   NLSRTL Version 12.2.0.1.0 - Production
   
   SQL> select '4' || 2 + 2 from dual;
   
     '4'||2+2
   ----------
        44
   
   SQL> select '44' || 2 + 2 from dual;
   
    '44'||2+2
   ----------
          444
   
   SQL> select '' || 2 + 2 from dual;
   
      ''||2+2
   ----------
         4
   
   SQL> select '4a' || 2 + 2 from dual;
   select '4a' || 2 + 2 from dual
                *
   ERROR at line 1:
   ORA-01722: invalid number
   
   SQL> select ':' || 2 + 2 from dual;
   select ':' || 2 + 2 from dual
               *
   ERROR at line 1:
   ORA-01722: invalid number
   
   SQL> select 'four: ' || 2 + 2 from dual;
   select 'four: ' || 2 + 2 from dual
                    *
   ERROR at line 1:
   ORA-01722: invalid number
   ```
   
![image](https://user-images.githubusercontent.com/5399861/59979056-2de56a00-9615-11e9-9db9-3b3e7c397af2.png)
   
   
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/About-SQL-Operators.html#GUID-FEF44762-F45C-41D9-B380-F6A61AD25338
   
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Concatenation-Operator.html#GUID-08C10738-706B-4290-B7CD-C279EBC90F7E

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