asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yingyi Bu (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (ASTERIXDB-1190) string-length function does not work in nested string fields
Date Tue, 24 May 2016 22:51:12 GMT

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

Yingyi Bu resolved ASTERIXDB-1190.
----------------------------------
    Resolution: Fixed

> string-length function does not work in nested string fields
> ------------------------------------------------------------
>
>                 Key: ASTERIXDB-1190
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1190
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: AsterixDB, Functions - AQL
>         Environment: Linux ubuntu 14.04 LTS
> AsterixDB 0.8.8
>            Reporter: Wail Alkowaileet
>            Assignee: Yingyi Bu
>
> Hi all,
> the string-length function throws an exception when it tries to compute the type.
> To reproduce:
> - Input
> {noformat}
> {
> 	"id":0,
> 	"b":{
> 		"c":{
> 			"d": "hi"
> 		}
> 	}
> },
> 	{
> 		"id":1,
> 	"b":{
> 		"c":{
> 			"d": "wail"
> 		}
> 	}
> }
> {noformat}
> - DDL:
> {noformat}
> use dataverse testStringDataverse
> create type testStringType as open
> {
> id: int32
> }
> create dataset stringTest(testStringType)
> primary key id
> {noformat}
> - DML:
> {noformat}
> use dataverse testStringDataverse
> insert into dataset stringTest(
> {
> 	"id":0,
> 	"b":{
> 		"c":{
> 			"d": "hi"
> 		}
> 	}
> }
> )
> {noformat}
> - AQL:
> {noformat}
> use dataverse testStringDataverse
> for $x in dataset stringTest
> return string-length($x.b.c.d)
> {noformat}
> Output:
> org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Cannot compute type
> 	at org.apache.asterix.om.typecomputer.impl.UnaryStringInt64OrNullTypeComputer.computeType(UnaryStringInt64OrNullTypeComputer.java:76)
> 	at org.apache.asterix.dataflow.data.common.AqlExpressionTypeComputer.getTypeForFunction(AqlExpressionTypeComputer.java:86)
> 	at org.apache.asterix.dataflow.data.common.AqlExpressionTypeComputer.getType(AqlExpressionTypeComputer.java:57)
> 	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.hasClosedType(SetClosedRecordConstructorsRule.java:180)
> 	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:164)
> 	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:79)
> 	at org.apache.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor.visitScalarFunctionCallExpression(AbstractConstVarFunVisitor.java:39)
> 	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
> 	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:153)
> 	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:79)
> 	at org.apache.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor.visitScalarFunctionCallExpression(AbstractConstVarFunVisitor.java:39)
> 	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
> 	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:153)
> 	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:79)
> 	at org.apache.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor.visitScalarFunctionCallExpression(AbstractConstVarFunVisitor.java:39)
> 	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
> 	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.transform(SetClosedRecordConstructorsRule.java:93)
> 	at org.apache.hyracks.algebricks.core.algebra.operators.logical.SelectOperator.acceptExpressionTransform(SelectOperator.java:83)
> 	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule.rewritePost(SetClosedRecordConstructorsRule.java:72)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:125)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:99)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:99)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:99)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:99)
> 	at org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController.rewriteWithRuleCollection(SequentialFixpointRuleController.java:53)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptimizer.runOptimizationSets(HeuristicOptimizer.java:95)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptimizer.optimize(HeuristicOptimizer.java:82)
> 	at org.apache.hyracks.algebricks.compiler.api.HeuristicCompilerFactoryBuilder$1$1.optimize(HeuristicCompilerFactoryBuilder.java:87)
> 	at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:289)
> 	at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1906)
> 	at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2481)
> 	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:393)
> 	at org.apache.asterix.api.http.servlet.RESTAPIServlet.handleRequest(RESTAPIServlet.java:195)
> 	at org.apache.asterix.api.http.servlet.AQLAPIServlet.handleRequest(AQLAPIServlet.java:29)
> 	at org.apache.asterix.api.http.servlet.RESTAPIServlet.doPost(RESTAPIServlet.java:162)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
> 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:546)
> 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:483)
> 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:970)
> 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:411)
> 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:904)
> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> 	at org.eclipse.jetty.server.Server.handle(Server.java:347)
> 	at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:439)
> 	at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:924)
> 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:781)
> 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
> 	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:43)
> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)
> 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
> 	at java.lang.Thread.run(Thread.java:745



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

Mime
View raw message