asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taewoo Kim (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ASTERIXDB-1155) Limit clause won't work within a function
Date Wed, 28 Oct 2015 00:21:27 GMT

    [ https://issues.apache.org/jira/browse/ASTERIXDB-1155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14977446#comment-14977446
] 

Taewoo Kim commented on ASTERIXDB-1155:
---------------------------------------

The reason of this issue is that CloneAndSubstituteVariablesVisitor tries to call accept()
on an offset expression in LimitClause which is null. I have fixed this issue and uploaded
a fix. 

> Limit clause won't work within a function
> -----------------------------------------
>
>                 Key: ASTERIXDB-1155
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1155
>             Project: Apache AsterixDB
>          Issue Type: Bug
>            Reporter: Steven Jacobs
>            Assignee: Taewoo Kim
>
> I can't find an example where a limit clause works within a function. Here is an example
of one that doesn't work:
> DDL:
> drop dataverse emergencyTest if exists;
> create dataverse emergencyTest;
> use dataverse emergencyTest;
> create type EmergencyReport as {
> 	"id":int,
> 	"intensity":int
> }
> create dataset EmergencyReports(EmergencyReport)
> primary key id;
> //This works fine
> for $emergency in dataset EmergencyReports
> limit 1
> return $emergency.message
> //this fails
> create function mostIntenseEarthquakeNearLocation() {
> for $emergency in dataset EmergencyReports
> limit 1
> return $emergency.message
> };
> for $result in mostIntenseEarthquakeNearLocation()
> return $result;
> I've tried many combinations. Here is the top of the stack trace:
> at org.apache.asterix.aql.rewrites.CloneAndSubstituteVariablesVisitor.visitLimitClause(CloneAndSubstituteVariablesVisitor.java:285)
> 	at org.apache.asterix.aql.rewrites.CloneAndSubstituteVariablesVisitor.visitLimitClause(CloneAndSubstituteVariablesVisitor.java:1)
> 	at org.apache.asterix.aql.expression.LimitClause.accept(LimitClause.java:67)
> 	at org.apache.asterix.aql.rewrites.CloneAndSubstituteVariablesVisitor.visitFlworExpression(CloneAndSubstituteVariablesVisitor.java:117)
> 	at org.apache.asterix.aql.rewrites.CloneAndSubstituteVariablesVisitor.visitFlworExpression(CloneAndSubstituteVariablesVisitor.java:1)
> 	at org.apache.asterix.aql.expression.FLWOGRExpression.accept(FLWOGRExpression.java:82)
> 	at org.apache.asterix.aql.rewrites.InlineUdfsVisitor.inlineUdfsInExpr(InlineUdfsVisitor.java:341)
> 	at org.apache.asterix.aql.rewrites.InlineUdfsVisitor.visitForClause(InlineUdfsVisitor.java:220)
> 	at org.apache.asterix.aql.rewrites.InlineUdfsVisitor.visitForClause(InlineUdfsVisitor.java:1)
> 	at org.apache.asterix.aql.expression.ForClause.accept(ForClause.java:70)
> 	at org.apache.asterix.aql.rewrites.InlineUdfsVisitor.visitFlworExpression(InlineUdfsVisitor.java:194)
> 	at org.apache.asterix.aql.rewrites.InlineUdfsVisitor.visitFlworExpression(InlineUdfsVisitor.java:1)
> 	at org.apache.asterix.aql.expression.FLWOGRExpression.accept(FLWOGRExpression.java:82)



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

Mime
View raw message