Skip to content

Commit

Permalink
feat: support window function lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
vbarua committed Aug 10, 2023
1 parent c93f826 commit 418ad58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ public SimpleExtension.ScalarFunctionVariant getScalarFunction(
return extensions.getScalarFunction(anchor);
}

public SimpleExtension.WindowFunctionVariant getWindowFunction(
int reference, SimpleExtension.ExtensionCollection extensions) {
var anchor = functionAnchorMap.get(reference);
if (anchor == null) {
throw new IllegalArgumentException(
"Unknown function id. Make sure that the function id provided was shared in the extensions section of the plan.");
}

return extensions.getWindowFunction(anchor);
}

public SimpleExtension.AggregateFunctionVariant getAggregateFunction(
int reference, SimpleExtension.ExtensionCollection extensions) {
var anchor = functionAnchorMap.get(reference);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ public interface ExtensionLookup {
SimpleExtension.ScalarFunctionVariant getScalarFunction(
int reference, SimpleExtension.ExtensionCollection extensions);

SimpleExtension.WindowFunctionVariant getWindowFunction(
int reference, SimpleExtension.ExtensionCollection extensions);

SimpleExtension.AggregateFunctionVariant getAggregateFunction(
int reference, SimpleExtension.ExtensionCollection extensions);

Expand Down

0 comments on commit 418ad58

Please sign in to comment.