You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/02 10:36:06 UTC
[GitHub] [spark] peter-toth commented on pull request #34693: [SPARK-37259][SQL] Support CTE and TempTable queries with MSSQL JDBC
peter-toth commented on pull request #34693:
URL: https://github.com/apache/spark/pull/34693#issuecomment-984501867
> > Unfortunately, it is non-trivial to split an arbitrary query it into "with" and "regular" clauses in MsSqlServerDialect.
>
> Could you please show us some example queries where the split is non-trivial?
For example:
```
WITH t AS (SELECT x FROM tbl), t2 AS (SELECT y FROM tbl2) SELECT * FROM t WHERE x > SELECT max(y) FROM t2
```
You need to split this to `WITH t AS (SELECT x FROM tbl), t2 AS (SELECT y FROM tbl2)` and `SELECT * FROM t WHERE x > SELECT max(y) FROM t2`. Obviously there can be more brackets in the query and some might not be paired/closed if they appear in strings like: `t2 AS (SELECT y, ')' AS dummy FROM tbl2)`. We could use ANTLR to parse the query just like we use it to parse Spark SQL statements but I'm not sure it is worth it...
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org