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/21 06:30:08 UTC
[GitHub] [arrow-datafusion] xudong963 edited a comment on pull request #1621: feat: Support Substring(str [from int] [for int])
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.
```
--
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