I am getting error in prestodb when running the fo...
# troubleshooting
y
I am getting error in prestodb when running the following query.
Copy code
select channel,
    sales_date,
    sum(sales) as sum_sales,
    sum(units) as sum_unts
from pinot.default.guestSlsLitm
where channel = 'WEB'
group by channel, sales_date
union all
select channel,
    sales_date,
    sum(sales) as sum_sales,
    sum(units) as sum_units
from pinot.default.guestSlsLitm
where channel = 'STORES'
group by channel, sales_date;
Each of the individual queries work separately. but the union does not. Even the explain plan fails with
Copy code
Query 20200825_180515_00000_mshj8 failed: Expected to find the pinot table handle for the scan node
com.facebook.presto.spi.PrestoException: Expected to find the pinot table handle for the scan node
	at com.facebook.presto.pinot.PinotPlanOptimizer.lambda$optimize$0(PinotPlanOptimizer.java:86)
Full Error
Copy code
com.facebook.presto.spi.PrestoException: Expected to find the pinot table handle for the scan node
	at com.facebook.presto.pinot.PinotPlanOptimizer.lambda$optimize$0(PinotPlanOptimizer.java:86)
	at java.base/java.util.Optional.orElseThrow(Optional.java:408)
	at com.facebook.presto.pinot.PinotPlanOptimizer.optimize(PinotPlanOptimizer.java:86)
	at com.facebook.presto.sql.planner.optimizations.ApplyConnectorOptimization.optimize(ApplyConnectorOptimization.java:132)
	at com.facebook.presto.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:187)
	at com.facebook.presto.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:176)
	at com.facebook.presto.sql.analyzer.QueryExplainer.getLogicalPlan(QueryExplainer.java:192)
	at com.facebook.presto.sql.analyzer.QueryExplainer.getLogicalPlan(QueryExplainer.java:183)
	at com.facebook.presto.sql.analyzer.QueryExplainer.getPlan(QueryExplainer.java:122)
	at com.facebook.presto.sql.rewrite.ExplainRewrite$Visitor.getQueryPlan(ExplainRewrite.java:135)
	at com.facebook.presto.sql.rewrite.ExplainRewrite$Visitor.visitExplain(ExplainRewrite.java:113)
	at com.facebook.presto.sql.rewrite.ExplainRewrite$Visitor.visitExplain(ExplainRewrite.java:62)
	at com.facebook.presto.sql.tree.Explain.accept(Explain.java:80)
	at com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:27)
	at com.facebook.presto.sql.rewrite.ExplainRewrite.rewrite(ExplainRewrite.java:59)
	at com.facebook.presto.sql.rewrite.StatementRewrite.rewrite(StatementRewrite.java:53)
	at com.facebook.presto.sql.analyzer.Analyzer.analyze(Analyzer.java:76)
	at com.facebook.presto.sql.analyzer.Analyzer.analyze(Analyzer.java:71)
	at com.facebook.presto.execution.SqlQueryExecution.<init>(SqlQueryExecution.java:167)
	at com.facebook.presto.execution.SqlQueryExecution.<init>(SqlQueryExecution.java:90)
	at com.facebook.presto.execution.SqlQueryExecution$SqlQueryExecutionFactory.createQueryExecution(SqlQueryExecution.java:682)
	at com.facebook.presto.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:116)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
x
i’m on this
@Devesh just fyi