-
Notifications
You must be signed in to change notification settings - Fork 25
fix sample by parsing #3011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DatGuyJonathan
merged 4 commits into
main
from
jonathan/eng-1423-sample_by-is-incorrectly-parsed-from-remote
Nov 18, 2025
Merged
fix sample by parsing #3011
DatGuyJonathan
merged 4 commits into
main
from
jonathan/eng-1423-sample_by-is-incorrectly-parsed-from-remote
Nov 18, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
apps/framework-cli/src/infrastructure/olap/clickhouse/sql_parser.rs
Outdated
Show resolved
Hide resolved
phiSgr
approved these changes
Nov 18, 2025
Collaborator
|
it's funny how much we have PRs titled similar to this |
okane16
pushed a commit
that referenced
this pull request
Nov 21, 2025
<!-- CURSOR_SUMMARY --> > [!NOTE] > Corrects SAMPLE BY extraction to terminate at TTL and avoids false matches in identifiers; adds targeted tests. > > - **SQL parsing (ClickHouse)**: > - Update `extract_sample_by_from_create_table` to terminate at `TTL` (with leading space) when extracting `SAMPLE BY`, preventing capture of TTL expressions and avoiding substring matches in identifiers. > - **Tests**: > - Add `test_extract_sample_by_with_ttl_single_line` to validate stopping at `TTL`. > - Add `test_extract_sample_by_with_identifier_containing_ttl` to ensure identifiers like `cattle_count` aren’t misinterpreted. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 021ac88. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
okane16
pushed a commit
that referenced
this pull request
Nov 21, 2025
<!-- CURSOR_SUMMARY --> > [!NOTE] > Corrects SAMPLE BY extraction to terminate at TTL and avoids false matches in identifiers; adds targeted tests. > > - **SQL parsing (ClickHouse)**: > - Update `extract_sample_by_from_create_table` to terminate at `TTL` (with leading space) when extracting `SAMPLE BY`, preventing capture of TTL expressions and avoiding substring matches in identifiers. > - **Tests**: > - Add `test_extract_sample_by_with_ttl_single_line` to validate stopping at `TTL`. > - Add `test_extract_sample_by_with_identifier_containing_ttl` to ensure identifiers like `cattle_count` aren’t misinterpreted. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 021ac88. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
okane16
pushed a commit
that referenced
this pull request
Nov 21, 2025
<!-- CURSOR_SUMMARY --> > [!NOTE] > Corrects SAMPLE BY extraction to terminate at TTL and avoids false matches in identifiers; adds targeted tests. > > - **SQL parsing (ClickHouse)**: > - Update `extract_sample_by_from_create_table` to terminate at `TTL` (with leading space) when extracting `SAMPLE BY`, preventing capture of TTL expressions and avoiding substring matches in identifiers. > - **Tests**: > - Add `test_extract_sample_by_with_ttl_single_line` to validate stopping at `TTL`. > - Add `test_extract_sample_by_with_identifier_containing_ttl` to ensure identifiers like `cattle_count` aren’t misinterpreted. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 021ac88. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
Corrects SAMPLE BY extraction to terminate at TTL and avoids false matches in identifiers; adds targeted tests.
extract_sample_by_from_create_tableto terminate atTTL(with leading space) when extractingSAMPLE BY, preventing capture of TTL expressions and avoiding substring matches in identifiers.test_extract_sample_by_with_ttl_single_lineto validate stopping atTTL.test_extract_sample_by_with_identifier_containing_ttlto ensure identifiers likecattle_countaren’t misinterpreted.Written by Cursor Bugbot for commit 021ac88. This will update automatically on new commits. Configure here.