question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Window function dependencies not in source plan output

See original GitHub issue
with t1 as (
  select orderkey, totalprice
  from tpch.tiny.orders
),
t2 as (
  select orderkey, totalprice, sum(totalprice) over () x
  from t1
),
t3 as (
  select orderkey, max(x) over()
  from t2
)
select * from t3
java.lang.IllegalArgumentException: Invalid node. Window function dependencies ([sum]) not in source plan output ([orderkey])
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
	at com.facebook.presto.sql.planner.sanity.ValidateDependenciesChecker.checkDependencies(ValidateDependenciesChecker.java:645)
	at com.facebook.presto.sql.planner.sanity.ValidateDependenciesChecker.access$100(ValidateDependenciesChecker.java:80)
	at com.facebook.presto.sql.planner.sanity.ValidateDependenciesChecker$Visitor.visitWindow(ValidateDependenciesChecker.java:187)
	at com.facebook.presto.sql.planner.sanity.ValidateDependenciesChecker$Visitor.visitWindow(ValidateDependenciesChecker.java:94)
	at com.facebook.presto.sql.planner.plan.WindowNode.accept(WindowNode.java:154)
	at com.facebook.presto.sql.planner.sanity.ValidateDependenciesChecker$Visitor.visitOutput(ValidateDependenciesChecker.java:303)
	at com.facebook.presto.sql.planner.sanity.ValidateDependenciesChecker$Visitor.visitOutput(ValidateDependenciesChecker.java:94)
	at com.facebook.presto.sql.planner.plan.OutputNode.accept(OutputNode.java:82)
	at com.facebook.presto.sql.planner.sanity.ValidateDependenciesChecker.validate(ValidateDependenciesChecker.java:91)
	at com.facebook.presto.sql.planner.sanity.ValidateDependenciesChecker.validate(ValidateDependenciesChecker.java:86)
	at com.facebook.presto.sql.planner.sanity.PlanSanityChecker.lambda$validate$0(PlanSanityChecker.java:44)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at com.facebook.presto.sql.planner.sanity.PlanSanityChecker.validate(PlanSanityChecker.java:44)
	at com.facebook.presto.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:127)
	at com.facebook.presto.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:111)
	at com.facebook.presto.execution.SqlQueryExecution.doAnalyzeQuery(SqlQueryExecution.java:297)
	at com.facebook.presto.execution.SqlQueryExecution.analyzeQuery(SqlQueryExecution.java:276)
	at com.facebook.presto.execution.SqlQueryExecution.start(SqlQueryExecution.java:234)
	at com.facebook.presto.execution.resourceGroups.InternalResourceGroup.lambda$startInBackground$1(InternalResourceGroup.java:478)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
maciejgrzybekcommented, Jan 31, 2017

I’ll look into it. Keep me assigned.

1reaction
electrumcommented, Jan 31, 2017

@cawallin Updated with a reproduction

Read more comments on GitHub >

github_iconTop Results From Across the Web

io.prestosql.sql.planner.plan.WindowNode$Function ... - Tabnine
ifPresent(referencedInputs::add); windowFunction.getFrame(). ... Window function dependencies (%s) not in source plan output (%s)", dependencies, node.
Read more >
How to use Window functions in SQL Server - SQLShack
This article explains the use of Aggregate, Raking and Value Windows Functions in SQL Server.
Read more >
Window function calls | BigQuery - Google Cloud
A window function, also known as an analytic function, computes values over a group of rows and returns a single result for each...
Read more >
Use the Object Dependencies pane to see how objects relate
Before you delete the query, you should find out if any of the other objects in the database, such as a form or...
Read more >
Command: plan | Terraform - HashiCorp Developer
The plan command alone does not actually carry out the proposed changes You ... to resource instances or to root module output values,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found