[ 
https://issues.apache.org/jira/browse/SPARK-28451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16890084#comment-16890084
 ] 

Shivu Sondur commented on SPARK-28451:
--------------------------------------

[~hyukjin.kwon], [~dongjoon]

Here one moreĀ  postgres compatible issue, Is it required to handle?

Aftter checking i found following
> Spark behavior is same asĀ *Oracle*,*mysql*
> and *MS Sql* behavior is same as *PostgreSQL*

I think we should have global settings like postgresql_Flavor, sql_Flavor 
parameter, if it is set corresponding flavor, all the function should behave 
accordingly to the database flavor.

> substr returns different values
> -------------------------------
>
>                 Key: SPARK-28451
>                 URL: https://issues.apache.org/jira/browse/SPARK-28451
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Tests
>    Affects Versions: 3.0.0
>            Reporter: Yuming Wang
>            Priority: Major
>
> PostgreSQL:
> {noformat}
> postgres=# select substr('1234567890', -1, 5);
>  substr
> --------
>  123
> (1 row)
> postgres=# select substr('1234567890', 1, -1);
> ERROR:  negative substring length not allowed
> {noformat}
> Spark SQL:
> {noformat}
> spark-sql> select substr('1234567890', -1, 5);
> 0
> spark-sql> select substr('1234567890', 1, -1);
> spark-sql>
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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

Reply via email to