[
https://issues.apache.org/jira/browse/VXQUERY-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15373090#comment-15373090
]
Preston Carman commented on VXQUERY-223:
----------------------------------------
The following query works:
{noformat}
for $y in (1,2,3)
return {"s":$y}
{noformat}
The issue could be related to collection.
> Result repetition
> -----------------
>
> Key: VXQUERY-223
> URL: https://issues.apache.org/jira/browse/VXQUERY-223
> Project: VXQuery
> Issue Type: Bug
> Reporter: Christina Pavlopoulou
> Priority: Minor
>
> When running
> {noformat}
> let $collection := "vxquery-xtest/src/test/resources/TestSources/ghcnd"
> for $r in collection($collection)/dataCollection/data
> return
> { "date": data($r/date), "datatype": data($r/dataType), "station":
> data($r/station), "attributes": ",,", "value": data($r/value) }
> {noformat}
> the values I get for each field name are repeated.
> This is the result I get:
> {noformat}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {"date":2004-04-04T00:00:00.000,"datatype":PRCP,"station":GHCND:US000000004,"attributes":",,","value":40}
> {noformat}
> The optimized plan is the following:
> {noformat}
> -- DISTRIBUTE_RESULT |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> unnest $$51 <- function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
> %0->$$49
> ]
> -- UNNEST |PARTITIONED|
> assign [$$49] <- [function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}object-constructor, Args:[
> function-call:
> vxquery:{urn:org.apache.vxquery.operators}concatenate, Args:[
> function-call:
> vxquery:{http://www.w3.org/2005/xpath-functions}string, Args:[
> {http://www.w3.org/2001/XMLSchema}string : date
> ]
> function-call:
> vxquery:{http://www.w3.org/2005/xpath-functions}data, Args:[
> vxquery:{urn:org.apache.vxquery.operators-ext}treat
> <item*>, Args:[
> %0->$$20
> ]
> ]
> function-call:
> vxquery:{http://www.w3.org/2005/xpath-functions}string, Args:[
> {http://www.w3.org/2001/XMLSchema}string : datatype
> ]
> function-call:
> vxquery:{http://www.w3.org/2005/xpath-functions}data, Args:[
> vxquery:{urn:org.apache.vxquery.operators-ext}treat
> <item*>, Args:[
> %0->$$28
> ]
> ]
> function-call:
> vxquery:{http://www.w3.org/2005/xpath-functions}string, Args:[
> {http://www.w3.org/2001/XMLSchema}string : station
> ]
> function-call:
> vxquery:{http://www.w3.org/2005/xpath-functions}data, Args:[
> vxquery:{urn:org.apache.vxquery.operators-ext}treat
> <item*>, Args:[
> %0->$$36
> ]
> ]
> function-call:
> vxquery:{http://www.w3.org/2005/xpath-functions}string, Args:[
> {http://www.w3.org/2001/XMLSchema}string : attributes
> ]
> {http://www.w3.org/2001/XMLSchema}string : ,,
> function-call:
> vxquery:{http://www.w3.org/2005/xpath-functions}string, Args:[
> {http://www.w3.org/2001/XMLSchema}string : value
> ]
> function-call:
> vxquery:{http://www.w3.org/2005/xpath-functions}data, Args:[
> vxquery:{urn:org.apache.vxquery.operators-ext}treat
> <item*>, Args:[
> %0->$$46
> ]
> ]
> ]
> ]]
> -- ASSIGN |PARTITIONED|
> subplan {
> aggregate [$$46] <- [function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}sequence, Args:[
> vxquery:{urn:org.apache.vxquery.operators-ext}child
> <element(NameTest({}value, {http://www.w3.org/2001/XMLSchema}anyType, nilled)
> >, Args:[
> vxquery:{urn:org.apache.vxquery.operators-ext}treat
> <node*>, Args:[
> %0->$$44
> ]
> ]
> ]]
> -- AGGREGATE |LOCAL|
> unnest $$44 <- function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
> %0->$$14
> ]
> -- UNNEST |LOCAL|
> nested tuple source
> -- NESTED_TUPLE_SOURCE |LOCAL|
> }
> -- SUBPLAN |PARTITIONED|
> subplan {
> aggregate [$$36] <- [function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}sequence, Args:[
> vxquery:{urn:org.apache.vxquery.operators-ext}child
> <element(NameTest({}station, {http://www.w3.org/2001/XMLSchema}anyType,
> nilled) >, Args:[
>
> vxquery:{urn:org.apache.vxquery.operators-ext}treat <node*>, Args:[
> %0->$$34
> ]
> ]
> ]]
> -- AGGREGATE |LOCAL|
> unnest $$34 <- function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
> %0->$$14
> ]
> -- UNNEST |LOCAL|
> nested tuple source
> -- NESTED_TUPLE_SOURCE |LOCAL|
> }
> -- SUBPLAN |PARTITIONED|
> subplan {
> aggregate [$$28] <- [function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}sequence, Args:[
> vxquery:{urn:org.apache.vxquery.operators-ext}child
> <element(NameTest({}dataType, {http://www.w3.org/2001/XMLSchema}anyType,
> nilled) >, Args:[
>
> vxquery:{urn:org.apache.vxquery.operators-ext}treat <node*>, Args:[
> %0->$$26
> ]
> ]
> ]]
> -- AGGREGATE |LOCAL|
> unnest $$26 <- function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
> %0->$$14
> ]
> -- UNNEST |LOCAL|
> nested tuple source
> -- NESTED_TUPLE_SOURCE |LOCAL|
> }
> -- SUBPLAN |PARTITIONED|
> subplan {
> aggregate [$$20] <- [function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}sequence, Args:[
>
> vxquery:{urn:org.apache.vxquery.operators-ext}child <element(NameTest({}date,
> {http://www.w3.org/2001/XMLSchema}anyType, nilled) >, Args:[
>
> vxquery:{urn:org.apache.vxquery.operators-ext}treat <node*>, Args:[
> %0->$$18
> ]
> ]
> ]]
> -- AGGREGATE |LOCAL|
> unnest $$18 <- function-call:
> vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
> %0->$$14
> ]
> -- UNNEST |LOCAL|
> nested tuple source
> -- NESTED_TUPLE_SOURCE |LOCAL|
> }
> -- SUBPLAN |PARTITIONED|
> unnest $$14 <-
> vxquery:{urn:org.apache.vxquery.operators-ext}child <element(NameTest({}data,
> {http://www.w3.org/2001/XMLSchema}anyType, nilled) >, Args:[
> %0->$$10
> ]
> -- UNNEST |PARTITIONED|
> unnest $$10 <-
> vxquery:{urn:org.apache.vxquery.operators-ext}child
> <element(NameTest({}dataCollection,
> {http://www.w3.org/2001/XMLSchema}anyType, nilled) >, Args:[
> %0->$$3
> ]
> -- UNNEST |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> data-scan []<-[$$3] <- VXQueryCollectionDataSource
> [collectionName=vxquery-xtest/src/test/resources/TestSources/ghcnd,
> childSeq=[]]
> -- DATASOURCE_SCAN |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> empty-tuple-source
> -- EMPTY_TUPLE_SOURCE |PARTITIONED|
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)