{"action":"opened","issue":{"url":"https://api.github.com/repos/prestodb/presto/issues/6215","repository_url":"https://api.github.com/repos/prestodb/presto","labels_url":"https://api.github.com/repos/prestodb/presto/issues/6215/labels{/name}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/6215/comments","events_url":"https://api.github.com/repos/prestodb/presto/issues/6215/events","html_url":"https://github.com/prestodb/presto/issues/6215","id":179839993,"number":6215,"title":"Planning error for correlated queries over Hive connector","user":{"login":"martint","id":14387,"avatar_url":"https://avatars.githubusercontent.com/u/14387?v=3","gravatar_id":"","url":"https://api.github.com/users/martint","html_url":"https://github.com/martint","followers_url":"https://api.github.com/users/martint/followers","following_url":"https://api.github.com/users/martint/following{/other_user}","gists_url":"https://api.github.com/users/martint/gists{/gist_id}","starred_url":"https://api.github.com/users/martint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martint/subscriptions","organizations_url":"https://api.github.com/users/martint/orgs","repos_url":"https://api.github.com/users/martint/repos","events_url":"https://api.github.com/users/martint/events{/privacy}","received_events_url":"https://api.github.com/users/martint/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/prestodb/presto/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"kokosing","id":7569403,"avatar_url":"https://avatars.githubusercontent.com/u/7569403?v=3","gravatar_id":"","url":"https://api.github.com/users/kokosing","html_url":"https://github.com/kokosing","followers_url":"https://api.github.com/users/kokosing/followers","following_url":"https://api.github.com/users/kokosing/following{/other_user}","gists_url":"https://api.github.com/users/kokosing/gists{/gist_id}","starred_url":"https://api.github.com/users/kokosing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokosing/subscriptions","organizations_url":"https://api.github.com/users/kokosing/orgs","repos_url":"https://api.github.com/users/kokosing/repos","events_url":"https://api.github.com/users/kokosing/events{/privacy}","received_events_url":"https://api.github.com/users/kokosing/received_events","type":"User","site_admin":false},"assignees":[{"login":"kokosing","id":7569403,"avatar_url":"https://avatars.githubusercontent.com/u/7569403?v=3","gravatar_id":"","url":"https://api.github.com/users/kokosing","html_url":"https://github.com/kokosing","followers_url":"https://api.github.com/users/kokosing/followers","following_url":"https://api.github.com/users/kokosing/following{/other_user}","gists_url":"https://api.github.com/users/kokosing/gists{/gist_id}","starred_url":"https://api.github.com/users/kokosing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokosing/subscriptions","organizations_url":"https://api.github.com/users/kokosing/orgs","repos_url":"https://api.github.com/users/kokosing/repos","events_url":"https://api.github.com/users/kokosing/events{/privacy}","received_events_url":"https://api.github.com/users/kokosing/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-09-28T17:47:29Z","updated_at":"2016-09-28T17:47:29Z","closed_at":null,"body":"Running the following query as part of TestHiveDistributedQueries fails with a planning error. It seems to happen during partition pruning.\r\n\r\n```sql\r\nSELECT count(*) \r\nFROM orders o \r\nWHERE EXISTS (\r\n    SELECT avg(l.orderkey) \r\n    FROM lineitem l \r\n    WHERE o.orderkey = l.orderkey \r\n    GROUP BY l.linenumber)\r\n```\r\n\r\n```\r\njava.lang.IllegalArgumentException: Missing column assignment for orderkey\r\n\r\n\tat com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)\r\n\tat com.facebook.presto.sql.planner.LookupSymbolResolver.getValue(LookupSymbolResolver.java:44)\r\n\tat com.facebook.presto.sql.planner.ExpressionInterpreter$Visitor.visitSymbolReference(ExpressionInterpreter.java:430)\r\n\tat com.facebook.presto.sql.tree.SymbolReference.accept(SymbolReference.java:38)\r\n\tat com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:22)\r\n\tat com.facebook.presto.sql.planner.ExpressionInterpreter$Visitor.visitComparisonExpression(ExpressionInterpreter.java:744)\r\n\tat com.facebook.presto.sql.tree.ComparisonExpression.accept(ComparisonExpression.java:133)\r\n\tat com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:22)\r\n\tat com.facebook.presto.sql.planner.ExpressionInterpreter.optimize(ExpressionInterpreter.java:254)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.shouldPrune(AddExchanges.java:659)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.lambda$planTableScan$4(AddExchanges.java:572)\r\n\tat com.facebook.presto.hive.HiveMetadata.lambda$getTableLayouts$5(HiveMetadata.java:1034)\r\n\tat java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)\r\n\tat java.util.Iterator.forEachRemaining(Iterator.java:116)\r\n\tat java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)\r\n\tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)\r\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)\r\n\tat java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)\r\n\tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)\r\n\tat com.facebook.presto.hive.HiveMetadata.getTableLayouts(HiveMetadata.java:1035)\r\n\tat com.facebook.presto.spi.connector.classloader.ClassLoaderSafeConnectorMetadata.getTableLayouts(ClassLoaderSafeConnectorMetadata.java:67)\r\n\tat com.facebook.presto.metadata.MetadataManager.getLayouts(MetadataManager.java:337)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planTableScan(AddExchanges.java:570)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitFilter(AddExchanges.java:513)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitFilter(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.FilterNode.accept(FilterNode.java:71)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitProject(AddExchanges.java:223)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitProject(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.ProjectNode.accept(ProjectNode.java:81)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitAggregation(AddExchanges.java:268)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitAggregation(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.AggregationNode.accept(AggregationNode.java:204)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitLimit(AddExchanges.java:477)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitLimit(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.LimitNode.accept(LimitNode.java:86)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitProject(AddExchanges.java:223)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitProject(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.ProjectNode.accept(ProjectNode.java:81)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitAggregation(AddExchanges.java:268)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitAggregation(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.AggregationNode.accept(AggregationNode.java:204)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitProject(AddExchanges.java:223)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitProject(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.ProjectNode.accept(ProjectNode.java:81)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitEnforceSingleRow(AddExchanges.java:243)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitEnforceSingleRow(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.EnforceSingleRowNode.accept(EnforceSingleRowNode.java:64)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitApply(AddExchanges.java:1140)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitApply(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.ApplyNode.accept(ApplyNode.java:96)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitFilter(AddExchanges.java:516)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitFilter(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.FilterNode.accept(FilterNode.java:71)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitAggregation(AddExchanges.java:268)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitAggregation(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.AggregationNode.accept(AggregationNode.java:204)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.planChild(AddExchanges.java:1152)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitOutput(AddExchanges.java:229)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges$Rewriter.visitOutput(AddExchanges.java:182)\r\n\tat com.facebook.presto.sql.planner.plan.OutputNode.accept(OutputNode.java:81)\r\n\tat com.facebook.presto.sql.planner.optimizations.AddExchanges.optimize(AddExchanges.java:144)\r\n\tat com.facebook.presto.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:116)\r\n\tat com.facebook.presto.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:107)\r\n\tat com.facebook.presto.execution.SqlQueryExecution.doAnalyzeQuery(SqlQueryExecution.java:291)\r\n\tat com.facebook.presto.execution.SqlQueryExecution.analyzeQuery(SqlQueryExecution.java:270)\r\n\tat com.facebook.presto.execution.SqlQueryExecution.start(SqlQueryExecution.java:228)\r\n\tat com.facebook.presto.execution.QueuedExecution.lambda$start$1(QueuedExecution.java:62)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n```\r\n"}}
{"actor":{"display_login":"martint"}}