Skip to content

Conversation

@DatGuyJonathan
Copy link
Contributor

@DatGuyJonathan DatGuyJonathan commented Nov 18, 2025

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.

Written by Cursor Bugbot for commit 021ac88. This will update automatically on new commits. Configure here.

@linear
Copy link

linear bot commented Nov 18, 2025

@vercel
Copy link

vercel bot commented Nov 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Nov 18, 2025 10:16pm
framework-docs Ready Ready Preview Comment Nov 18, 2025 10:16pm

@phiSgr
Copy link
Collaborator

phiSgr commented Nov 18, 2025

it's funny how much we have PRs titled similar to this

@DatGuyJonathan DatGuyJonathan added this pull request to the merge queue Nov 18, 2025
Merged via the queue into main with commit 22ccf62 Nov 18, 2025
86 of 88 checks passed
@DatGuyJonathan DatGuyJonathan deleted the jonathan/eng-1423-sample_by-is-incorrectly-parsed-from-remote branch November 18, 2025 23:18
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants