ilovesoup / asterixdb

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

Weird field order in constructed records in an open types scenario #374

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Do the AqlAdm101 demo but use only open types and only identify the primary key 
fields, and then try Query 3 -- in this case the uname field comes after the 
messages field in the newly constructed records.  One could well argue that 
this shouldn't matter since attribute name ordering is not supposed to matter - 
but - seems undesirable, no?  Here's its output:

{ "messages": [ " dislike iphone its touch-screen is horrible", " can't stand 
at&t the network is horrible:(", " like verizon the 3G is awesome:)", " can't 
stand motorola the touch-screen is terrible", " can't stand at&t its plan is 
terrible" ], "uname": "MargaritaStoddard" }
{ "messages": [ " like samsung the plan is amazing", " like t-mobile its 
platform is mind-blowing" ], "uname": "IsbelDull" }
{ "messages": [ " love sprint its shortcut-menu is awesome:)", " love verizon 
its wireless is good" ], "uname": "EmoryUnk" }
{ "messages": [  ], "uname": "NicholasStroh" }
{ "messages": [ " dislike sprint the speed is horrible" ], "uname": "VonKemble" 
}
{ "messages": [ " love sprint the customization is mind-blowing" ], "uname": 
"WillisWynne" }
{ "messages": [ " like iphone the voicemail-service is awesome" ], "uname": 
"SuzannaTillson" }
{ "messages": [  ], "uname": "NilaMilliron" }
{ "messages": [ " love at&t its 3G is good:)" ], "uname": "WoodrowNehling" }
{ "messages": [ " dislike iphone the voice-command is bad:(", " can't stand 
t-mobile its voicemail-service is OMG:(" ], "uname": "BramHatch" }

For convenience, here is more detail on the repro steps:

drop dataverse TinySocial if exists;
create dataverse TinySocial;
use dataverse TinySocial;

create type TwitterUserType as open {
        screen-name: string
}

create type TweetMessageType as open {
        tweetid: string
}

create type FacebookUserType as open {
        id: int32
}

create type FacebookMessageType as open {
        message-id: int32
}

use dataverse TinySocial;

create dataset FacebookUsers(FacebookUserType)
primary key id;

create dataset FacebookMessages(FacebookMessageType)
primary key message-id;

create dataset TwitterUsers(TwitterUserType)
primary key screen-name;

create dataset TweetMessages(TweetMessageType)
primary key tweetid
hints(cardinality=100); 

use dataverse TinySocial;

load dataset FacebookUsers using localfs
(("path"="127.0.0.1:///Users/mikejcarey/tinysocialdata/fbu.adm"),("format"="adm"
));

load dataset FacebookMessages using localfs
(("path"="127.0.0.1:///Users/mikejcarey/tinysocialdata/fbm.adm"),("format"="adm"
));

load dataset TwitterUsers using localfs
(("path"="127.0.0.1:///Users/mikejcarey/tinysocialdata/twu.adm"),("format"="adm"
));

load dataset TweetMessages using localfs
(("path"="127.0.0.1:///Users/mikejcarey/tinysocialdata/twm.adm"),("format"="adm"
));

use dataverse TinySocial;

for $user in dataset FacebookUsers
return {
"uname": $user.name,
"messages": for $message in dataset FacebookMessages
                where $message.author-id = $user.id
                return $message.message
};

Original issue reported on code.google.com by dtab...@gmail.com on 21 Apr 2013 at 8:23

GoogleCodeExporter commented 9 years ago

Original comment by vinay...@gmail.com on 24 May 2013 at 8:31

GoogleCodeExporter commented 9 years ago
Issue 393 has been merged into this issue.

Original comment by vinay...@gmail.com on 24 May 2013 at 8:47

GoogleCodeExporter commented 9 years ago

Original comment by zheilb...@gmail.com on 24 May 2013 at 8:48

GoogleCodeExporter commented 9 years ago

Original comment by zheilb...@gmail.com on 24 May 2013 at 8:48