-
Notifications
You must be signed in to change notification settings - Fork 96
fix(spark)!: derive the dialect from core's model and the runtime's functions #1133
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,10 +42,13 @@ object SparkExtension { | |||||||||||||||||||||||||||||||||||
| ret.toSeq | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| val toAggregateFunction: ToAggregateFunction = ToAggregateFunction( | ||||||||||||||||||||||||||||||||||||
| EXTENSION_COLLECTION.aggregateFunctions().asScala.toSeq) | ||||||||||||||||||||||||||||||||||||
| lazy val StandardAggregateFunctions: Seq[SimpleExtension.AggregateFunctionVariant] = | ||||||||||||||||||||||||||||||||||||
| EXTENSION_COLLECTION.aggregateFunctions().asScala.toSeq | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| val toWindowFunction: ToWindowFunction = ToWindowFunction( | ||||||||||||||||||||||||||||||||||||
| lazy val StandardWindowFunctions: Seq[SimpleExtension.WindowFunctionVariant] = | ||||||||||||||||||||||||||||||||||||
| EXTENSION_COLLECTION.windowFunctions().asScala.toSeq | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+45
to
49
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The narrowing makes the generator match the runtime, which is right. The side effect is that a If the narrowing is the deliberate choice, worth marking so the next person doesn't read the omission as an oversight:
Suggested change
|
||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| val toAggregateFunction: ToAggregateFunction = ToAggregateFunction(StandardAggregateFunctions) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| val toWindowFunction: ToWindowFunction = ToWindowFunction(StandardWindowFunctions) | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
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.
dialectrewrites this same file, and nothing orders the two tasks:./gradlew test dialectrunstestfirst, so it can validate the pre-regeneration content, pass, and leave the file modified. Confirmed with--dry-run.Declaring the file as an
outputs.fileondialectis not enough on its own — Gradle does not infer the dependency from plain-Stringinputs.file/outputs.filepairs, and I verifiedteststill ran first with the output declared. The ordering has to be explicit:Worth adding
outputs.file("../spark_dialect.yaml")to the registration on line 149 as well, separately — that getsdialectup-to-date checking instead of re-running on every invocation:I checked drift is still handled with that in place: corrupting the YAML makes the task re-run and repair it, so the only visible change is
dialectreportingUP-TO-DATEwhen nothing moved.Note this variant is the only one that needs
mustRunAfter—dialectis registered here alone, so the same line in the 3.4/3.5 build files would fail on an unknown task. A short comment there explaining why the input is content-only would save the next reader the trip.