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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]