EnxDev commented on code in PR #44708:
URL: https://github.com/apache/superset/pull/44708#discussion_r4137506369
##########
tests/unit_tests/sql/dialects/db2_tests.py:
##########
@@ -244,3 +244,22 @@ def test_column_plus_literal_duration() -> None:
# Should parse as (col + 1 DAYS), not (col + 1) AS DAYS
assert regenerated == "SELECT col + 1 DAYS FROM t"
+
+
[email protected](
+ ("sql", "expected"),
+ [
+ ("SELECT * FROM t LIMIT 10 OFFSET 2", "SELECT * FROM t LIMIT 10 OFFSET
2"),
+ (
+ "SELECT * FROM (SELECT 1 AS a FROM t) AS x LIMIT 5",
+ "SELECT * FROM (SELECT 1 AS a FROM t) AS x LIMIT 5",
+ ),
+ ("SELECT a % 3 FROM t LIMIT 4", "SELECT a % 3 FROM t LIMIT 4"),
Review Comment:
This one never reaches the `parse_mod=False` path. The `%` is in the select
list, so before the fix it only failed because of the LIMIT, same as the first
case. I removed the `parse_mod=parse_mod` forwarding locally and all 28 tests
still passed.
`LIMIT 10 %` is the input sqlglot passes the flag for (it reads the `%` as
PERCENT), and it fails once the forwarding is gone:
```suggestion
("SELECT * FROM t LIMIT 10 %", "SELECT * FROM t LIMIT 10 PERCENT"),
```
--
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]