shamim8888 / asterixdb

Automatically exported from code.google.com/p/asterixdb
0 stars 0 forks source link

Bug with open records in RecordMergeDescriptor class? #898

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Running the following query will reproduce the problem:
"create dataverse abc if not exists;
use dataverse abc;
drop dataset xDS if exists;
drop type xType if exists;
create type xType as open {
     user-id:string
}
create dataset xDS(xType)
primary key user-id;

drop dataset yDS if exists;
drop type yType if exists;
create type yType as open {
    id:string
}
create dataset yDS(yType)
primary key id;

insert into dataset xDS({
    "user-id":"33", 
    "employer":"UCSD",
    "country":{
          "County": "San Diego", 
          "Country":"USA"}
});

insert into dataset yDS({
    "id":"11",
    "address":"21 Harvey Dr.", 
    "zipcode":{
        "state":"CA",
        "code":"22001"},
    "country":{
        "County": "San Diego", 
        "Country":"USA"}});
let $z:=""
for $d in dataset xDS
    for $e in dataset yDS 
    return record-merge($d,$e,$z);"

What is the expected output? What do you see instead?
A merged record of $d and $e but get "Internal error. Please check instance 
logs for further details. [NullPointerException]"

What version of the product are you using? On what operating system?
Incubator-asterixdb branch (github) (0.8.7)

Please provide any additional information below.
The above problem happens because the input argument "combinedType" of the 
method  "addFieldToSubRecord(combinedType, leftName, leftValue, rightValue..." 
(see line 164 in "RecordMergeDescriptor" class is null when the value of an 
open field  is a sub-record (inside an input record).

Original issue reported on code.google.com by hrama...@uci.edu on 10 Jun 2015 at 9:44