You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Till Westmann (JIRA)" <ji...@apache.org> on 2016/07/05 22:03:11 UTC

[jira] [Updated] (ASTERIXDB-1515) NPE running SQL++ query with undefined variable

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

Till Westmann updated ASTERIXDB-1515:
-------------------------------------
    Description: 
The query
{noformat}
declare function abc(y) {
 3
};

let z =y
select element z;
{noformat}
(a fixed version of asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/udf30/udf30.1.query.sqlpp) fails with an NPE:
{noformat}
java.lang.NullPointerException
	at org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression.toString(VariableReferenceExpression.java:68)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalExpressionPrettyPrintVisitor.visitVariableReferenceExpression(LogicalExpressionPrettyPrintVisitor.java:43)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalExpressionPrettyPrintVisitor.visitVariableReferenceExpression(LogicalExpressionPrettyPrintVisitor.java:31)
	at org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression.accept(VariableReferenceExpression.java:102)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor.pprintExprList(LogicalOperatorPrettyPrintVisitor.java:494)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor.visitAssignOperator(LogicalOperatorPrettyPrintVisitor.java:184)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor.visitAssignOperator(LogicalOperatorPrettyPrintVisitor.java:70)
	at org.apache.hyracks.algebricks.core.algebra.operators.logical.AssignOperator.accept(AssignOperator.java:63)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printOperator(PlanPrettyPrinter.java:46)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printOperator(PlanPrettyPrinter.java:58)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printOperator(PlanPrettyPrinter.java:58)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printPlan(PlanPrettyPrinter.java:34)
	at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:224)
	at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1965)
	at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2541)
	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:389)
	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:253)
	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:148)
{noformat}



  was:
The query
{noformat}
declare function abc(y) {
 3
};

let z =y
select element z;
{noformat}
(a fixed version of 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/udf30/udf30.1.query.sqlpp) fails with an NPE:
{noformat}
java.lang.NullPointerException
	at org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression.toString(VariableReferenceExpression.java:68)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalExpressionPrettyPrintVisitor.visitVariableReferenceExpression(LogicalExpressionPrettyPrintVisitor.java:43)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalExpressionPrettyPrintVisitor.visitVariableReferenceExpression(LogicalExpressionPrettyPrintVisitor.java:31)
	at org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression.accept(VariableReferenceExpression.java:102)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor.pprintExprList(LogicalOperatorPrettyPrintVisitor.java:494)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor.visitAssignOperator(LogicalOperatorPrettyPrintVisitor.java:184)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor.visitAssignOperator(LogicalOperatorPrettyPrintVisitor.java:70)
	at org.apache.hyracks.algebricks.core.algebra.operators.logical.AssignOperator.accept(AssignOperator.java:63)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printOperator(PlanPrettyPrinter.java:46)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printOperator(PlanPrettyPrinter.java:58)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printOperator(PlanPrettyPrinter.java:58)
	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printPlan(PlanPrettyPrinter.java:34)
	at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:224)
	at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1965)
	at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2541)
	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:389)
	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:253)
	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:148)
{noformat}




> NPE running SQL++ query with undefined variable
> -----------------------------------------------
>
>                 Key: ASTERIXDB-1515
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1515
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: Optimizer
>            Reporter: Till Westmann
>            Assignee: Yingyi Bu
>
> The query
> {noformat}
> declare function abc(y) {
>  3
> };
> let z =y
> select element z;
> {noformat}
> (a fixed version of asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/udf30/udf30.1.query.sqlpp) fails with an NPE:
> {noformat}
> java.lang.NullPointerException
> 	at org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression.toString(VariableReferenceExpression.java:68)
> 	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalExpressionPrettyPrintVisitor.visitVariableReferenceExpression(LogicalExpressionPrettyPrintVisitor.java:43)
> 	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalExpressionPrettyPrintVisitor.visitVariableReferenceExpression(LogicalExpressionPrettyPrintVisitor.java:31)
> 	at org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression.accept(VariableReferenceExpression.java:102)
> 	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor.pprintExprList(LogicalOperatorPrettyPrintVisitor.java:494)
> 	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor.visitAssignOperator(LogicalOperatorPrettyPrintVisitor.java:184)
> 	at org.apache.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor.visitAssignOperator(LogicalOperatorPrettyPrintVisitor.java:70)
> 	at org.apache.hyracks.algebricks.core.algebra.operators.logical.AssignOperator.accept(AssignOperator.java:63)
> 	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printOperator(PlanPrettyPrinter.java:46)
> 	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printOperator(PlanPrettyPrinter.java:58)
> 	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printOperator(PlanPrettyPrinter.java:58)
> 	at org.apache.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter.printPlan(PlanPrettyPrinter.java:34)
> 	at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:224)
> 	at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1965)
> 	at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2541)
> 	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:389)
> 	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:253)
> 	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:148)
> {noformat}



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