xudong963 edited a comment on pull request #1621:
URL: 
https://github.com/apache/arrow-datafusion/pull/1621#issuecomment-1018217879


   Hi, @ovr I do some case tests with Postgres in my local. The followings are 
some differences.
   
   ```
   // postgres
   postgres=# select * from t;
     a
   -----
    123
   (1 row)
   
   postgres=#  select substring(a,0,3) from t;
    substring
   -----------
    12
   (1 row)
   
   postgres=#  select substring(a,-1, 3) from t;
    substring
   -----------
    1
   (1 row)
   
   // datafusion:pr1621
   ❯ select * from t;
   +-----+
   | c   |
   +-----+
   | 123 |
   +-----+
   1 row in set. Query took 0.009 seconds.
   
   ❯ select substring(c,0,3) from t;
   +-------------------------------+
   | substr(t.c,Int64(0),Int64(3)) |
   +-------------------------------+
   | 123                           |
   +-------------------------------+
   
   ❯ select substring(c,-1,3) from t;
   +--------------------------------+
   | substr(t.c,Int64(-1),Int64(3)) |
   +--------------------------------+
   | 123                            |
   +--------------------------------+
   1 row in set. Query took 0.010 seconds.
   ```
   
   BTW, It'll be better to integration testing to compare with postgres


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


Reply via email to