}
List<FunctionCall> windowFunctions = extractor.getWindowFunctions();
for (FunctionCall windowFunction : windowFunctions) {
Window window = windowFunction.getWindow().get();
WindowFunctionExtractor nestedExtractor = new WindowFunctionExtractor();
for (Expression argument : windowFunction.getArguments()) {
nestedExtractor.process(argument, null);
}
for (Expression expression : window.getPartitionBy()) {
nestedExtractor.process(expression, null);
}
for (SortItem sortItem : window.getOrderBy()) {
nestedExtractor.process(sortItem.getSortKey(), null);
}
if (window.getFrame().isPresent()) {
nestedExtractor.process(window.getFrame().get(), null);
}
if (!nestedExtractor.getWindowFunctions().isEmpty()) {
throw new SemanticException(NESTED_WINDOW, node, "Cannot nest window functions inside window function '%s': %s",
windowFunction,
extractor.getWindowFunctions());
}
if (windowFunction.isDistinct()) {
throw new SemanticException(NOT_SUPPORTED, node, "DISTINCT in window function parameters not yet supported: %s", windowFunction);
}
if (window.getFrame().isPresent()) {
throw new SemanticException(NOT_SUPPORTED, node, "Window frames not yet supported");
}
List<Type> argumentTypes = Lists.transform(windowFunction.getArguments(), new Function<Expression, Type>()
{