You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/06/05 06:38:59 UTC
[jira] [Commented] (ASTERIXDB-1212) Close-type list doesn't handle
NULL well
[ https://issues.apache.org/jira/browse/ASTERIXDB-1212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15315773#comment-15315773 ]
ASF subversion and git services commented on ASTERIXDB-1212:
------------------------------------------------------------
Commit 273c7a5665943c351245f39221f28270584e968e in incubator-asterixdb's branch refs/heads/master from [~buyingyi]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-asterixdb.git;h=273c7a5 ]
ASTERIXDB-1212: fixes and test cases.
Change-Id: I0b5fc5c09dfffa11ff8debb69e85ead894b4a597
Reviewed-on: https://asterix-gerrit.ics.uci.edu/908
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Jianfeng Jia <ji...@gmail.com>
> Close-type list doesn't handle NULL well
> -----------------------------------------
>
> Key: ASTERIXDB-1212
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-1212
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: AsterixDB, Data Model
> Reporter: Jianfeng Jia
> Assignee: Yingyi Bu
>
> First, I observed the out of range access for the closed-type list and open-type list are quite different:
> {code}
> // closed type:
> let $all := [ { "ka":"a1", "kb":"b1"},
> { "ka":"a2", "kb":"b2"}]
> return $all[3].ka
> {code}
> It returns a "", I think it should be null.
> If I change the type to a hytogenous type like below
> {code}
> // open type:
> let $all := [ { "ka":"a1", "kb":"b1"},
> { "ka":2, "kb":"b2"}]
> return $all[3].ka
> {code}
> It returns a null as expected.
> Furthermore, the closed-type will return the wrong result by just access field by index other than by name. Here is example
> {code}
> let $all := [ { "ka":"a1", "kb":"b1"},
> { "ka":"a2", "kb":"b2"}]
> for $x in $all
> group by $k := $x.kb with $x
> return { "g": $k, "s1": $x[1].ka}
> {code}
> It returns
> {code}
> { "g": "b1", "s1": "b1" }
> { "g": "b2", "s1": "b2" }
> {code}
> It seems it skipped some offset directly without verify if the record is null or not.
> The open type doesn't have this problem. The following code
> {code}
> let $all := [ { "ka":"a1", "kb":"b1"},
> { "ka":2, "kb":"b2"}] // change ka to 2 to make a heterogenous type list
> for $x in $all
> group by $k := $x.kb with $x
> return { "g": $k, "s1": $x[1].ka}
> {code}
> will always return
> {code}
> { "g": "b1", "s1": null }
> { "g": "b2", "s1": null }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)