tajo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Min Zhou (JIRA)" <j...@apache.org>
Subject [jira] [Created] (TAJO-469) CTAS with no column definition will get a NPE
Date Tue, 31 Dec 2013 07:35:52 GMT
Min Zhou created TAJO-469:
-----------------------------

             Summary: CTAS with no column definition will get  a NPE
                 Key: TAJO-469
                 URL: https://issues.apache.org/jira/browse/TAJO-469
             Project: Tajo
          Issue Type: Bug
          Components: planner/optimizer
    Affects Versions: 0.8-incubating
            Reporter: Min Zhou


If you do a CTAS like this way 

{noformat}
create table  tbl partition by column(key float8) as select l_orderkey, l_partkey, l_quantity
as key from lineitem;
{noformat}

You will get an NPE because that expr.getTableElements() returns null and this null value
later be iterated.

{noformat}
2013-12-30 23:28:55,582 ERROR master.GlobalEngine (GlobalEngine.java:executeQuery(177)) -

Stack Trace:
java.lang.NullPointerException
	at org.apache.tajo.engine.planner.LogicalPlanner.convertTableElementsSchema(LogicalPlanner.java:956)
	at org.apache.tajo.engine.planner.LogicalPlanner.convertTableElementsPartition(LogicalPlanner.java:844)
	at org.apache.tajo.engine.planner.LogicalPlanner.visitCreateTable(LogicalPlanner.java:785)
	at org.apache.tajo.engine.planner.LogicalPlanner.visitCreateTable(LogicalPlanner.java:81)
	at org.apache.tajo.engine.planner.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:98)
	at org.apache.tajo.engine.planner.LogicalPlanner.createPlan(LogicalPlanner.java:114)
	at org.apache.tajo.master.GlobalEngine.createLogicalPlan(GlobalEngine.java:225)
	at org.apache.tajo.master.GlobalEngine.executeQuery(GlobalEngine.java:138)
	at org.apache.tajo.master.TajoMasterClientService$TajoMasterClientProtocolServiceHandler.submitQuery(TajoMasterClientService.java:134)
	at org.apache.tajo.ipc.TajoMasterClientProtocol$TajoMasterClientProtocolService$2.callBlockingMethod(TajoMasterClientProtocol.java:257)
	at org.apache.tajo.rpc.BlockingRpcServer$ServerHandler.messageReceived(BlockingRpcServer.java:91)
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
	at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
	at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
	at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
	at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
	at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
	at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
	at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
	at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:680)
{noformat}

I think this is caused by one of the different between  create table DDL and CTAS.   We can
legally create a table by CTAS without define each columns' schema, just can use the output
schema of select clause.  But, create table DDL can't do it.




--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message