Repository navigation
Conversation
LucaCappelletti94
left a comment
There was a problem hiding this comment.
Most of the changes are AI-slopped documentation. Please only include actually necessary documentation, read it, and not just greenlight AI generated documentation.
The code itself looks okay.
|
Marking as draft as I think this PR is no longer waiting on feedback and I am trying to make it easier to find PRs in need of review. Please mark it as ready for review when it is ready for another look |
|
Thanks for the contribution @fmcmac and the review @LucaCappelletti94 |
parse_pattern, parse_json_table_column_def and parse_key_value_options recurse on nested input without a depth guard. So does parse_joins, on Snowflake join chains without parentheses. Deep enough input overflows the stack. The first 3 now take a guard on entry. parse_joins takes one on its recursive call. parse_pattern now reads `a | b | c` in a loop rather than recursing once per alternative, so the guard counts nesting, not alternatives. Generated-by: Claude Code
56d8335 to
7dcc189
Compare
|
Mea culpa @LucaCappelletti94, I have removed the comments. Rebased onto main. #2411 and #2422 cover the data type and interval paths, so I dropped those parts. I removed the parse_prefix change, because prefix caching covers the slowdown and the change rejected valid SQL. Tests now align with the existing style. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2440 +/- ##
==========================================
+ Coverage 82.54% 82.55% +0.01%
==========================================
Files 42 42
Lines 35553 35555 +2
Branches 35553 35555 +2
==========================================
+ Hits 29346 29354 +8
Misses 2672 2672
+ Partials 3535 3529 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Dialects: Snowflake, MySQL, Generic
Nested shapes avoid the recursion limit, overflowing the stack instead of returning
RecursionLimitExceeded:MATCH_RECOGNIZE(PATTERN ((((a)))) ...)JSON_TABLE(... COLUMNS(NESTED PATH '$' COLUMNS(...)))COPY_OPTIONS=(a=(a=(...)))SELECT * FROM t JOIN t JOIN t ..., without parenthesesAdded recursion guard for
parse_pattern,parse_json_table_column_def,parse_key_value_optionsand the recursive call inparse_joins.The depth tests overflow on main. Additional tests check that a flat 100-way
PATTERNalternation and nested parenthesised joins still parse.This PR was written with Claude Code. I have read and reviewed every line.