Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
0.11.0
-
None
-
None
Description
It's hard to summary this problem to me.. please understand.
This is origin query of TPC-DS q8.
select s_store_name ,sum(ss_net_profit) from store_sales ,date_dim ,store, (select ca_zip from ( SELECT substr(ca_zip,1,5) ca_zip FROM customer_address WHERE substr(ca_zip,1,5) IN ( '24128', '76232', '65084', '87816', '83926' ,[......and so on....] , '27385', '61860', '58048', '56910', '16807' , '17871', '35258', '31387', '35458', '35576') intersect select ca_zip from (SELECT substr(ca_zip,1,5) ca_zip,count(*) cnt FROM customer_address, customer WHERE ca_address_sk = c_current_addr_sk and c_preferred_cust_flag='Y' group by ca_zip having count(*) > 10)A1)A2) V1 where ss_store_sk = s_store_sk and ss_sold_date_sk = d_date_sk and d_qoy = 2 and d_year = 1998 and (substr(s_zip,1,2) = substr(V1.ca_zip,1,2)) group by s_store_name order by s_store_name limit 100;
When I enter this query, tajo gives me this message.
ERROR: column name 'tpcds.customer_address.ca_zip (TEXT), tpcds.a1.ca_zip (TEXT)' is ambiguous
I think this error is derived from ambiguous column definition.
so, to resolve this error, I indicate table name of every CA_ZIP like below.
select s_store_name ,sum(ss_net_profit) from store_sales ,date_dim ,store, (select A2.ca_zip from ( SELECT substr(customer_address.ca_zip,1,5) ca_zip FROM customer_address WHERE substr(customer_address.ca_zip,1,5) IN ( '24128', '76232', '65084', '87816', '83926' ,[....and so on.......] , '27385', '61860', '58048', '56910', '16807' , '17871', '35258', '31387', '35458', '35576') intersect select A1.ca_zip from (SELECT substr(customer_address.ca_zip,1,5) ca_zip,count(*) cnt FROM customer_address, customer WHERE ca_address_sk = c_current_addr_sk and c_preferred_cust_flag='Y' group by ca_zip having count(*) > 10)A1)A2) V1 where ss_store_sk = s_store_sk and ss_sold_date_sk = d_date_sk and d_qoy = 2 and d_year = 1998 and (substr(s_zip,1,2) = substr(V1.ca_zip,1,2)) group by s_store_name order by s_store_name limit 100;
then tajo gives me another error message
ERROR: internal error: %s: org.apache.tajo.plan.logical.ProjectionNode cannot be cast to org.apache.tajo.plan.logical.BinaryNode
Here is error log in tajo-master-log.
2015-08-17 15:48:41,412 ERROR org.apache.tajo.master.GlobalEngine: Stack Trace: java.lang.ClassCastException: org.apache.tajo.plan.logical.ProjectionNode cannot be cast to org.apache.tajo.plan.logical.BinaryNode at org.apache.tajo.plan.LogicalPlanner.buildSetPlan(LogicalPlanner.java:1555) at org.apache.tajo.plan.LogicalPlanner.visitIntersect(LogicalPlanner.java:1517) at org.apache.tajo.plan.LogicalPlanner.visitIntersect(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:87) at org.apache.tajo.plan.LogicalPlanner.visitTableSubQuery(LogicalPlanner.java:1394) at org.apache.tajo.plan.LogicalPlanner.visitTableSubQuery(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:93) at org.apache.tajo.plan.LogicalPlanner.visitRelationList(LogicalPlanner.java:1283) at org.apache.tajo.plan.LogicalPlanner.visitRelationList(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:96) at org.apache.tajo.plan.LogicalPlanner.visitProjection(LogicalPlanner.java:256) at org.apache.tajo.plan.LogicalPlanner.visitProjection(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:60) at org.apache.tajo.plan.LogicalPlanner.visitTableSubQuery(LogicalPlanner.java:1394) at org.apache.tajo.plan.LogicalPlanner.visitTableSubQuery(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:93) at org.apache.tajo.plan.LogicalPlanner.visitRelationList(LogicalPlanner.java:1291) at org.apache.tajo.plan.LogicalPlanner.visitRelationList(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:96) at org.apache.tajo.plan.LogicalPlanner.visitFilter(LogicalPlanner.java:1092) at org.apache.tajo.plan.LogicalPlanner.visitFilter(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:78) at org.apache.tajo.plan.LogicalPlanner.visitGroupBy(LogicalPlanner.java:980) at org.apache.tajo.plan.LogicalPlanner.visitGroupBy(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:72) at org.apache.tajo.plan.LogicalPlanner.visitSort(LogicalPlanner.java:870) at org.apache.tajo.plan.LogicalPlanner.visitSort(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:66) at org.apache.tajo.plan.LogicalPlanner.visitLimit(LogicalPlanner.java:812) at org.apache.tajo.plan.LogicalPlanner.visitLimit(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:63) at org.apache.tajo.plan.LogicalPlanner.visitProjection(LogicalPlanner.java:256) at org.apache.tajo.plan.LogicalPlanner.visitProjection(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:60) at org.apache.tajo.plan.LogicalPlanner.createPlan(LogicalPlanner.java:161) at org.apache.tajo.plan.LogicalPlanner.createPlan(LogicalPlanner.java:149) at org.apache.tajo.master.GlobalEngine.createLogicalPlan(GlobalEngine.java:272) at org.apache.tajo.master.GlobalEngine.executeQuery(GlobalEngine.java:194) at org.apache.tajo.master.TajoMasterClientService$TajoMasterClientProtocolServiceHandler.submitQuery(TajoMasterClientService.java:304) at org.apache.tajo.ipc.TajoMasterClientProtocol$TajoMasterClientProtocolService$2.callBlockingMethod(TajoMasterClientProtocol.java:659) at org.apache.tajo.rpc.BlockingRpcServer$ServerHandler.channelRead0(BlockingRpcServer.java:100) at org.apache.tajo.rpc.BlockingRpcServer$ServerHandler.channelRead0(BlockingRpcServer.java:61) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) at org.apache.tajo.rpc.MonitorServerHandler.channelRead(MonitorServerHandler.java:70) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111) at java.lang.Thread.run(Thread.java:745)