alamb commented on PR #3279:
URL:
https://github.com/apache/arrow-datafusion/pull/3279#issuecomment-1236818578
🤔 so I actually tried out 'show create table' with a view and it already
does canonicalize the SQL, it seems:
```sql
DataFusion CLI v11.0.0
❯ create table t as select * from (values (1), (2), (3)) as sq;
+---------+
| column1 |
+---------+
| 1 |
| 2 |
| 3 |
+---------+
3 rows in set. Query took 0.050 seconds.
❯ create view v as select column1 /*my random comment*/ from t where column1
!= 1;
0 rows in set. Query took 0.001 seconds.
❯ show create table v;
+---------------+--------------+------------+-----------------------------------------------------------+
| table_catalog | table_schema | table_name | definition
|
+---------------+--------------+------------+-----------------------------------------------------------+
| datafusion | public | v | CREATE VIEW v AS SELECT
column1 FROM t WHERE column1 <> 1 |
+---------------+--------------+------------+-----------------------------------------------------------+
1 row in set. Query took 0.015 seconds.
```
(note the lack of ` /*my random comment*/ ` and the transformation of `!=`
to `<>`)
I believe this means that DataFusion is storing the canonicalized SQL string
from sqlparser
--
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]