You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/27 08:09:55 UTC

[GitHub] [arrow-datafusion] xudong963 commented on issue #1688: Testing result of String related built-in functions

xudong963 commented on issue #1688:
URL: https://github.com/apache/arrow-datafusion/issues/1688#issuecomment-1022950128


   About `substr` & `substring`
   
   I believe now datafusion supports `substring` and `select substring("" from x for y)`. BTW the behavior is the same as Postgres.
   ```sql
   ❯ SELECT substring('Spark SQL', -3);
   +-------------------------------------+
   | substr(Utf8("Spark SQL"),Int64(-3)) |
   +-------------------------------------+
   | Spark SQL                           |
   +-------------------------------------+
   1 row in set. Query took 0.006 seconds.
   ❯ SELECT substr('Spark SQL', -3);
   +-------------------------------------+
   | substr(Utf8("Spark SQL"),Int64(-3)) |
   +-------------------------------------+
   | Spark SQL                           |
   +-------------------------------------+
   1 row in set. Query took 0.006 seconds.
   ❯ SELECT substring('Spark SQL' from 5 for 1);
   +---------------------------------------------+
   | substr(Utf8("Spark SQL"),Int64(5),Int64(1)) |
   +---------------------------------------------+
   | k                                           |
   +---------------------------------------------+
   1 row in set. Query took 0.007 seconds.
   ```
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org