asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vignesh Raghunathan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ASTERIXDB-1571) Subquery in from clause throws NullPointerException
Date Fri, 12 Aug 2016 08:40:20 GMT

     [ https://issues.apache.org/jira/browse/ASTERIXDB-1571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vignesh Raghunathan updated ASTERIXDB-1571:
-------------------------------------------
    Description: 
To reproduce the issue, run the following sqlpp statements

{code}
drop dataverse sampdb if exists;
create dataverse sampdb;
use sampdb;

drop dataset samptable if exists;
drop type samptabletype if exists;

create type samptabletype as closed {
  id: int8
};

create dataset samptable(samptabletype) primary key id;

insert into samptable ({'id' : 0});
insert into samptable ({'id' : 1});

select *
from
(
select * from samptable
)
{code}

Result:

{{monospaced}}
Aug 12, 2016 1:57:08 PM org.apache.asterix.api.http.servlet.APIServlet doPost
SEVERE: null
java.lang.NullPointerException
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:130)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.clause.Projection.accept(Projection.java:45)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:193)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.clause.SelectRegular.accept(SelectRegular.java:40)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:169)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.clause.SelectClause.accept(SelectClause.java:42)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:140)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.struct.SetOperationInput.accept(SetOperationInput.java:56)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:201)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.clause.SelectSetOperation.accept(SelectSetOperation.java:47)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:223)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.expression.SelectExpression.accept(SelectExpression.java:55)
	at org.apache.asterix.lang.sqlpp.util.SqlppFormatPrintUtil.toString(SqlppFormatPrintUtil.java:90)
	at org.apache.asterix.lang.sqlpp.util.SqlppFormatPrintUtil.toString(SqlppFormatPrintUtil.java:76)
	at org.apache.asterix.lang.sqlpp.util.ExpressionToVariableUtil.getGeneratedIdentifier(ExpressionToVariableUtil.java:48)
	at org.apache.asterix.lang.sqlpp.util.ExpressionToVariableUtil.getGeneratedVariable(ExpressionToVariableUtil.java:91)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.FromTerm(SQLPPParser.java:3767)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.FromClause(SQLPPParser.java:3674)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SelectBlock(SQLPPParser.java:3342)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SelectSetOperation(SQLPPParser.java:3255)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SelectExpression(SQLPPParser.java:3226)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.Query(SQLPPParser.java:2176)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SingleStatement(SQLPPParser.java:414)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.Statement(SQLPPParser.java:325)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.parse(SQLPPParser.java:260)
	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:119)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
	at org.eclipse.jetty.server.Server.handle(Server.java:524)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
	at java.lang.Thread.run(Thread.java:745)
{{monospaced}}


  was:
To reproduce the issue, run the following sqlpp statements

{code}
drop dataset samptable if exists;
drop type samptabletype if exists;

create type samptabletype as closed {
  id: int8
};

create dataset samptable(samptabletype) primary key id;

insert into samptable ({'id' : 0});
insert into samptable ({'id' : 1});

select *
from
(
select * from samptable
)
{code}

Result:

{code}
Aug 12, 2016 1:57:08 PM org.apache.asterix.api.http.servlet.APIServlet doPost
SEVERE: null
java.lang.NullPointerException
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:130)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.clause.Projection.accept(Projection.java:45)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:193)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.clause.SelectRegular.accept(SelectRegular.java:40)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:169)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.clause.SelectClause.accept(SelectClause.java:42)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:140)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.struct.SetOperationInput.accept(SetOperationInput.java:56)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:201)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.clause.SelectSetOperation.accept(SelectSetOperation.java:47)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:223)
	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
	at org.apache.asterix.lang.sqlpp.expression.SelectExpression.accept(SelectExpression.java:55)
	at org.apache.asterix.lang.sqlpp.util.SqlppFormatPrintUtil.toString(SqlppFormatPrintUtil.java:90)
	at org.apache.asterix.lang.sqlpp.util.SqlppFormatPrintUtil.toString(SqlppFormatPrintUtil.java:76)
	at org.apache.asterix.lang.sqlpp.util.ExpressionToVariableUtil.getGeneratedIdentifier(ExpressionToVariableUtil.java:48)
	at org.apache.asterix.lang.sqlpp.util.ExpressionToVariableUtil.getGeneratedVariable(ExpressionToVariableUtil.java:91)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.FromTerm(SQLPPParser.java:3767)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.FromClause(SQLPPParser.java:3674)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SelectBlock(SQLPPParser.java:3342)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SelectSetOperation(SQLPPParser.java:3255)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SelectExpression(SQLPPParser.java:3226)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.Query(SQLPPParser.java:2176)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SingleStatement(SQLPPParser.java:414)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.Statement(SQLPPParser.java:325)
	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.parse(SQLPPParser.java:260)
	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:119)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
	at org.eclipse.jetty.server.Server.handle(Server.java:524)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
	at java.lang.Thread.run(Thread.java:745)
{code}



> Subquery in from clause throws NullPointerException
> ---------------------------------------------------
>
>                 Key: ASTERIXDB-1571
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1571
>             Project: Apache AsterixDB
>          Issue Type: Bug
>         Environment: Master branch with latest commit id: bd3a535b171a5cc7486175
>            Reporter: Vignesh Raghunathan
>
> To reproduce the issue, run the following sqlpp statements
> {code}
> drop dataverse sampdb if exists;
> create dataverse sampdb;
> use sampdb;
> drop dataset samptable if exists;
> drop type samptabletype if exists;
> create type samptabletype as closed {
>   id: int8
> };
> create dataset samptable(samptabletype) primary key id;
> insert into samptable ({'id' : 0});
> insert into samptable ({'id' : 1});
> select *
> from
> (
> select * from samptable
> )
> {code}
> Result:
> {{monospaced}}
> Aug 12, 2016 1:57:08 PM org.apache.asterix.api.http.servlet.APIServlet doPost
> SEVERE: null
> java.lang.NullPointerException
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:130)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
> 	at org.apache.asterix.lang.sqlpp.clause.Projection.accept(Projection.java:45)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:193)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
> 	at org.apache.asterix.lang.sqlpp.clause.SelectRegular.accept(SelectRegular.java:40)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:169)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
> 	at org.apache.asterix.lang.sqlpp.clause.SelectClause.accept(SelectClause.java:42)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:140)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
> 	at org.apache.asterix.lang.sqlpp.struct.SetOperationInput.accept(SetOperationInput.java:56)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:201)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
> 	at org.apache.asterix.lang.sqlpp.clause.SelectSetOperation.accept(SelectSetOperation.java:47)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:223)
> 	at org.apache.asterix.lang.sqlpp.visitor.SqlppFormatPrintVisitor.visit(SqlppFormatPrintVisitor.java:1)
> 	at org.apache.asterix.lang.sqlpp.expression.SelectExpression.accept(SelectExpression.java:55)
> 	at org.apache.asterix.lang.sqlpp.util.SqlppFormatPrintUtil.toString(SqlppFormatPrintUtil.java:90)
> 	at org.apache.asterix.lang.sqlpp.util.SqlppFormatPrintUtil.toString(SqlppFormatPrintUtil.java:76)
> 	at org.apache.asterix.lang.sqlpp.util.ExpressionToVariableUtil.getGeneratedIdentifier(ExpressionToVariableUtil.java:48)
> 	at org.apache.asterix.lang.sqlpp.util.ExpressionToVariableUtil.getGeneratedVariable(ExpressionToVariableUtil.java:91)
> 	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.FromTerm(SQLPPParser.java:3767)
> 	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.FromClause(SQLPPParser.java:3674)
> 	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SelectBlock(SQLPPParser.java:3342)
> 	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SelectSetOperation(SQLPPParser.java:3255)
> 	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SelectExpression(SQLPPParser.java:3226)
> 	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.Query(SQLPPParser.java:2176)
> 	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.SingleStatement(SQLPPParser.java:414)
> 	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.Statement(SQLPPParser.java:325)
> 	at org.apache.asterix.lang.sqlpp.parser.SQLPPParser.parse(SQLPPParser.java:260)
> 	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:119)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
> 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
> 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
> 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
> 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> 	at org.eclipse.jetty.server.Server.handle(Server.java:524)
> 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
> 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
> 	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
> 	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
> 	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
> 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
> 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
> 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
> 	at java.lang.Thread.run(Thread.java:745)
> {{monospaced}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message