-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Disallow aggregation function as UNNEST parameter
#17988
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
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 |
|---|---|---|
|
|
@@ -138,8 +138,9 @@ public ScalarFunctionImplementation getScalarFunctionImplementation( | |
|
|
||
| private SpecializedSqlScalarFunction specializeScalarFunction(FunctionId functionId, BoundSignature boundSignature, FunctionDependencies functionDependencies) | ||
| { | ||
| SqlScalarFunction function = (SqlScalarFunction) getSqlFunction(functionId); | ||
| return function.specialize(boundSignature, functionDependencies); | ||
| SqlFunction function = getSqlFunction(functionId); | ||
| checkArgument(function instanceof SqlScalarFunction, "%s is not a scalar function", function.getFunctionMetadata().getSignature()); | ||
|
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. We need unit tests for that and this is an SQL error so we need a proper UX error.
Contributor
Author
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. On my eye it is not SQL error. It is kind of invariant that should be satisfied here. We have similar here:
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. This should already be handled during SQL analysis by
Contributor
Author
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. Yes, this case is handled by |
||
| return ((SqlScalarFunction) function).specialize(boundSignature, functionDependencies); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -156,8 +157,9 @@ public AggregationImplementation getAggregationImplementation(FunctionId functio | |
|
|
||
| private AggregationImplementation specializedAggregation(FunctionId functionId, BoundSignature boundSignature, FunctionDependencies functionDependencies) | ||
| { | ||
| SqlAggregationFunction aggregationFunction = (SqlAggregationFunction) functions.get(functionId); | ||
| return aggregationFunction.specialize(boundSignature, functionDependencies); | ||
| SqlFunction function = getSqlFunction(functionId); | ||
| checkArgument(function instanceof SqlAggregationFunction, "%s is not an aggregation function", function.getFunctionMetadata().getSignature()); | ||
| return ((SqlAggregationFunction) function).specialize(boundSignature, functionDependencies); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -174,8 +176,9 @@ public WindowFunctionSupplier getWindowFunctionSupplier(FunctionId functionId, B | |
|
|
||
| private WindowFunctionSupplier specializeWindow(FunctionId functionId, BoundSignature boundSignature, FunctionDependencies functionDependencies) | ||
| { | ||
| SqlWindowFunction function = (SqlWindowFunction) functions.get(functionId); | ||
| return function.specialize(boundSignature, functionDependencies); | ||
| SqlFunction function = functions.get(functionId); | ||
| checkArgument(function instanceof SqlWindowFunction, "%s is not a window function", function.getFunctionMetadata().getSignature()); | ||
| return ((SqlWindowFunction) function).specialize(boundSignature, functionDependencies); | ||
| } | ||
|
|
||
| private SqlFunction getSqlFunction(FunctionId functionId) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.