-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor!: improve transpilation of JSON paths across dialects (#2883)
* Refactor!: improve transpilation of JSON paths across dialects * Improve test coverage * Catch json path parse errors so that the sql parser is more lenient * Add support for more DuckDB variants * Add more tests * Reduce multi-arg MySQL JSON_EXTRACT to single-arg * Add a single-arg test * Add support for Postgres' JSON_EXTRACT_PATH variant * Add support for T-SQL's JSON_QUERY/VALUE * Fix MySQL, handle SQLite multi-arg variant * PR feedback * Get rid of copy * Refactor JSON representation: create proper AST (subclass of Expression) * Type hint TRANSFORMS * Style * Get rid of special parsing logic for MySQL, SQLite, produce multi-arg JSONExtract instead * Nested path tests, unsupported tests, json path mapping refactor * Use lstrip * Factor out is_int * Move is_int to helper.py * arrow_json_extract_sql cleanup * Cleanup expression arg_types * Improve test * Add another test
- Loading branch information
1 parent
2fb1e9f
commit b4e8868
Showing
24 changed files
with
905 additions
and
450 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.