Description
Cannot run 'with' with tajo, so I'm modifying a part of origin query.
Origin query
with cross_items as (select i_item_sk ss_item_sk from item, (select iss.i_brand_id brand_id ,iss.i_class_id class_id ,iss.i_category_id category_id from store_sales ,item iss ,date_dim d1 where ss_item_sk = iss.i_item_sk and ss_sold_date_sk = d1.d_date_sk and d1.d_year between 1999 AND 1999 + 2 intersect select ics.i_brand_id ,ics.i_class_id ,ics.i_category_id from catalog_sales ,item ics ,date_dim d2 where cs_item_sk = ics.i_item_sk and cs_sold_date_sk = d2.d_date_sk and d2.d_year between 1999 AND 1999 + 2 intersect select iws.i_brand_id ,iws.i_class_id ,iws.i_category_id from web_sales ,item iws ,date_dim d3 where ws_item_sk = iws.i_item_sk and ws_sold_date_sk = d3.d_date_sk and d3.d_year between 1999 AND 1999 + 2) where i_brand_id = brand_id and i_class_id = class_id and i_category_id = category_id )
modified query
create table cross_items_temp(brand_id bigint, class_id bigint, category_id bigint); insert overwrite into cross_items_temp select iss.i_brand_id brand_id ,iss.i_class_id class_id ,iss.i_category_id category_id from store_sales ,item iss ,date_dim d1 where ss_item_sk = iss.i_item_sk and ss_sold_date_sk = d1.d_date_sk and d1.d_year between 1999 AND 1999 + 2 intersect select ics.i_brand_id ,ics.i_class_id ,ics.i_category_id from catalog_sales ,item ics ,date_dim d2 where cs_item_sk = ics.i_item_sk and cs_sold_date_sk = d2.d_date_sk and d2.d_year between 1999 AND 1999 + 2 intersect select iws.i_brand_id ,iws.i_class_id ,iws.i_category_id from web_sales ,item iws ,date_dim d3 where ws_item_sk = iws.i_item_sk and ws_sold_date_sk = d3.d_date_sk and d3.d_year between 1999 AND 1999 + 2;
but i take an internal error
ERROR: internal error: %s: org.apache.tajo.plan.logical.ProjectionNode cannot be cast to org.apache.tajo.plan.logical.BinaryNode
here is master log
2015-08-07 17:31:42,503 INFO org.apache.tajo.master.GlobalEngine: Query: insert overwrite into cross_items_temp select iss.i_brand_id brand_id ,iss.i_class_id class_id ,iss.i_category_id category_id from store_sales ,item iss ,date_dim d1 where ss_item_sk = iss.i_item_sk and ss_sold_date_sk = d1.d_date_sk and d1.d_year between 1999 AND 1999 + 2 intersect select ics.i_brand_id ,ics.i_class_id ,ics.i_category_id from catalog_sales ,item ics ,date_dim d2 where cs_item_sk = ics.i_item_sk and cs_sold_date_sk = d2.d_date_sk and d2.d_year between 1999 AND 1999 + 2 intersect select iws.i_brand_id ,iws.i_class_id ,iws.i_category_id from web_sales ,item iws ,date_dim d3 where ws_item_sk = iws.i_item_sk and ws_sold_date_sk = d3.d_date_sk and d3.d_year between 1999 AND 1999 + 2 2015-08-07 17:31:42,550 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.buildSetPlan(LogicalPlanner.java:1533) 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.algebra.BaseAlgebraVisitor.visitInsert(BaseAlgebraVisitor.java:510) at org.apache.tajo.plan.LogicalPlanner.visitInsert(LogicalPlanner.java:1581) at org.apache.tajo.plan.LogicalPlanner.visitInsert(LogicalPlanner.java:76) at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:137) 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)