-
-
Notifications
You must be signed in to change notification settings - Fork 653
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
Spark3: Add Direct File Query #2553
Spark3: Add Direct File Query #2553
Conversation
reorganized file grammar to isolate file formats that allow this removed xml file format for now since requires additonal work
Codecov Report
@@ Coverage Diff @@
## main #2553 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 163 163
Lines 11828 11838 +10
=========================================
+ Hits 11828 11838 +10
Continue to review full report at Codecov.
|
this ensures a match on file reference and files are not matched as tables
…erenceSegment ran sqlfluff fix on tests and updated yml again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One question and one nit.
@tunetheweb - I'll work on the review comments today. Thank you! Do you have a suggestion or similar PR you could point me to for adjusting L057 since identifier is required in this case? It shouldn't raise the rule here. |
In L057 there is already an exception for BigQuery: # BigQuery table references are quoted in back ticks so allow dots
#
# It also allows a star at the end of table_references for wildcards
# (https://cloud.google.com/bigquery/docs/querying-wildcard-tables)
#
# Strip both out before testing the identifier
if (
context.dialect.name in ["bigquery"]
and context.parent_stack
and context.parent_stack[-1].name == "TableReferenceSegment"
):
if identifier[-1] == "*":
identifier = identifier[:-1]
identifier = identifier.replace(".", "") You could do something similar for this: # Allow slashes in file references
if (
context.parent_stack
and context.parent_stack[-1].type == "file_reference"
):
identifier = identifier.replace("/", "") |
Yep, just added them and running pytest locally then will push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Brief summary of the change made
Are there any other side effects of this change that we should be aware of?
Reorganized some grammar for Files to isolate File keywords that support this clause.
Removed "XML" File format. No test cases and requires additional work before it will parse correctly.
Linting fails due to special characters in identifiers (L057). These special keywords are required so would be an exception to L057. I've not yet worked on rules so would appreciate any guidance on where to get started on fixing this particular bug.
Pull Request checklist
Please confirm you have completed any of the necessary steps below.
Included test cases to demonstrate any code changes, which may be one or more of the following:
.yml
rule test cases intest/fixtures/rules/std_rule_cases
..sql
/.yml
parser test cases intest/fixtures/dialects
(note YML files can be auto generated withtox -e generate-fixture-yml
).test/fixtures/linter/autofix
.Added appropriate documentation for the change.
Created GitHub issues for any relevant followup/future enhancements if appropriate.