-
Notifications
You must be signed in to change notification settings - Fork 0
fix(kql-to-duckdb): add support for negated string operators #44
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
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
- Add handlers for !contains, !startswith, !endswith, !has - Translate to NOT LIKE and NOT REGEXP for valid DuckDB SQL - Add comprehensive tests for all string operators (8 tests passing) - Update package.json test scripts
- Add ArrayLiteral expression type to kql-ast - Update kql-lezer grammar to parse array literals (e.g., (1, 2, 3)) - Add CST-to-AST conversion for ArrayLiteral nodes - Implement in/!in operator translation to SQL IN/NOT IN - Add tests for in/!in operators with numbers and strings - All tests passing: kql-lezer (110), kql-to-duckdb (12)
- Remove generated files from git (kql.grammar, parser.ts, parser.terms.ts) - Add generated files to .gitignore - Update build script to auto-generate: grammar → parser → TypeScript - Add fix:parser step to add @ts-nocheck to generated parser - Update documentation in README.md and CLAUDE.md - Build process now: generate:grammar → build:parser → fix:parser → tsc - All tests passing (110 tests)
Contributor
Author
Update: Grammar Generation AutomatedThe grammar generation process is now fully automated in the build pipeline: What Changed
Developer WorkflowTo modify the grammar:
Documentation updated in README.md and CLAUDE.md. This comment was created by an AI agent on behalf of @sushruth. |
- Check both error.toString() and error.stderr for npm error messages - Bun's ShellError contains npm output in stderr property - Add more specific error message for 'You cannot publish over' error - Improve error logging to show both error and stderr output
- Add ArrayLiteral rule to src/grammar/plugins/rules/expressions.ts - Import 'many' helper function for grammar generation - Fixes test failures in kql-to-duckdb that were using old parser - All tests passing: kql-lezer (110), kql-to-duckdb (12)
- Add kql.grammar, parser.ts, parser.terms.ts to turbo.json outputs - Ensures generated files are cached and available for tests in CI - Fixes 'Cannot find module ./parser' errors in CI pipeline
- Add turbo.json to build task inputs - Ensures cache is invalidated when Turbo configuration changes - Prevents stale cache issues in CI when outputs/inputs are modified
- Add --force flag to turbo build command temporarily - Ensures generated parser files are created in this PR run - TODO: Remove --force after cache is refreshed
- Remove --force flag from build command (cache is now refreshed) - Add turbo.json to inputs for test, test:coverage, and lint tasks - Ensures all tasks invalidate cache when Turbo config changes - Prevents future stale cache issues across all tasks
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.
Summary
Adds complete support for negated string operators and in/!in operators in kql-to-duckdb translator.
Changes
Negated String Operators
!contains,!startswith,!endswith,!hasin expression translatorNOT LIKEandNOT REGEXPfor valid DuckDB SQLArray Literals & in/!in Operators
ArrayLiteralexpression type to kql-ast(value1, value2, ...)in/!inoperator translation to SQLIN/NOT INTesting
Examples
Negated String Operators
in/!in Operators
This PR was created by an AI agent on behalf of @sushruth.