[ASTERIXDB-2671][FUN] Fix handling nullable inputs in OBJECT_*()
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
The input record to OBJECT_*() functions can be nullable/missable
record.
- fixed the type inferrer to take care of that when inferring
the input record type.
Change-Id: Ic7e86598eda03f5aeb3c0e4457127c99bdbed0e4
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/4123
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.1.ddl.sqlpp
index 3f0e361..8ed1ec1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.1.ddl.sqlpp
@@ -74,3 +74,12 @@
message : string
};
+create type TinySocial.TweetMessageType2 as
+{
+ tweetid : string,
+ user : TwitterUserType?,
+ `sender-location` : point?,
+ `send-time` : datetime,
+ `referred-topics` : {{string}},
+ `message-text` : string
+};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.2.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.2.ddl.sqlpp
index e78240e..41cac2d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.2.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.2.ddl.sqlpp
@@ -33,6 +33,8 @@
create dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
+create dataset TweetMessages2(TweetMessageType2) primary key tweetid hints (`CARDINALITY`=`100`);
+
create index fbUserSinceIdx on FacebookUsers (`user-since`) type btree;
create index fbAuthorIdx on FacebookMessages (`author-id`) type btree;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.3.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.3.update.sqlpp
index ec7b327..12649d3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.3.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.3.update.sqlpp
@@ -33,3 +33,4 @@
load dataset TweetMessages using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
+load dataset TweetMessages2 using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.5.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.5.query.sqlpp
new file mode 100644
index 0000000..a369915
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.5.query.sqlpp
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description : Testing get-object-field-value under different queries.
+* Expected Res : Success
+*/
+
+use TinySocial;
+
+select element TinySocial.`get-object-field-value`(m.user, "screen-name")
+from TweetMessages2 as m
+where m.tweetid = "1";
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.01.ddl.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.01.ddl.sqlpp
index a23dcf9..742a007 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.01.ddl.sqlpp
@@ -114,3 +114,12 @@
message : string
};
+create type TinySocial.TweetMessageType2 as
+ {
+ tweetid : string,
+ user : TwitterUserType?,
+ `sender-location` : point?,
+ `send-time` : datetime,
+ `referred-topics` : {{string}},
+ `message-text` : string
+};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.02.ddl.sqlpp
similarity index 94%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.02.ddl.sqlpp
index ef32bf9..ea3b0bb 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.02.ddl.sqlpp
@@ -33,6 +33,8 @@
create dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
+create dataset TweetMessages2(TweetMessageType2) primary key tweetid hints (`CARDINALITY`=`100`);
+
create index fbUserSinceIdx on FacebookUsers (`user-since`) type btree;
create index fbAuthorIdx on FacebookMessages (`author-id`) type btree;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.3.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.03.update.sqlpp
similarity index 94%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.3.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.03.update.sqlpp
index 7d73a99..2b91e94 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.3.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.03.update.sqlpp
@@ -33,6 +33,8 @@
load dataset TweetMessages using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
+load dataset TweetMessages2 using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
+
insert into TwitterUsersAlternate
select element {'screen-name':r.`screen-name`,'lang':r.lang,'friends_count':r.friends_count,'statuses_count':r.statuses_count}
from TwitterUsers as r
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.04.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.04.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.05.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.05.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.06.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.06.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.07.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.07.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.08.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.08.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.09.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.09.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.10.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.10.query.sqlpp
new file mode 100644
index 0000000..269672e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.10.query.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description : Testing get-object-fields under different queries.
+* Expected Res : Success
+*/
+
+use TinySocial;
+
+
+select element TinySocial.`get-object-fields`(message.user)
+from TweetMessages2 as message
+where (message.tweetid = "1");
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.1.ddl.sqlpp
index a50bf21..d1d5a5e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.1.ddl.sqlpp
@@ -44,6 +44,13 @@
`message-text` : string
};
+create type TinySocial.TweetMessageType2 as {
+ tweetid : string,
+ user : TwitterUserType?
+};
+
create dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
create dataset TweetMessages(TweetMessageType) primary key tweetid;
+
+create dataset TweetMessages2(TweetMessageType2) primary key tweetid;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.2.update.sqlpp
index 1bd2260..b51fe17 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.2.update.sqlpp
@@ -27,3 +27,5 @@
load dataset TwitterUsers using localfs ((`path`=`asterix_nc1://data/tinysocial/twu.adm`),(`format`=`adm`));
load dataset TweetMessages using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
+
+load dataset TweetMessages2 using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.3.query.sqlpp
index 67d88d9..d34b736 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_length/object_length.3.query.sqlpp
@@ -52,5 +52,11 @@
"t5": (
select distinct value object_length(user)
from TweetMessages as t
+ ),
+
+ /* nullable/missable type */
+ "t6": (
+ select distinct value object_length(user)
+ from TweetMessages2 as t
)
};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.1.ddl.sqlpp
index 4f507b1..078c631 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.1.ddl.sqlpp
@@ -44,6 +44,13 @@
`message-text` : string
};
+create type TinySocial.TweetMessageType2 as {
+ tweetid : string,
+ user : TwitterUserType?
+};
+
create dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
create dataset TweetMessages(TweetMessageType) primary key tweetid;
+
+create dataset TweetMessages2(TweetMessageType2) primary key tweetid;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.2.update.sqlpp
index cf03bed..1260086 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.2.update.sqlpp
@@ -27,3 +27,5 @@
load dataset TwitterUsers using localfs ((`path`=`asterix_nc1://data/tinysocial/twu.adm`),(`format`=`adm`));
load dataset TweetMessages using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
+
+load dataset TweetMessages2 using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.3.query.sqlpp
index ae20bb0..1c53260 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_names/object_names.3.query.sqlpp
@@ -55,5 +55,12 @@
select distinct string_join((select value f from g order by f), ",") res
from TweetMessages as t, object_names(t) f
group by t.tweetid group as g
+ ),
+
+ /* nullable/missable type */
+ "t6": (
+ select distinct string_join((select value f from g order by f), ",") res
+ from TweetMessages2 as t, object_names(t.user) f
+ group by t.tweetid group as g
)
}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.1.ddl.sqlpp
index 30c5e02..545fad6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.1.ddl.sqlpp
@@ -27,4 +27,16 @@
id : bigint
};
+create type Emp as {
+
+};
+
+create type FacebookUserType2 as
+ open {
+ id : bigint,
+ employment : [Emp]?
+};
+
create dataset FacebookUsers(FacebookUserType) primary key id;
+
+create dataset FacebookUsers2(FacebookUserType2) primary key id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.2.update.sqlpp
index cdb516e..f9a2288 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.2.update.sqlpp
@@ -21,3 +21,5 @@
use TinySocial;
load dataset FacebookUsers using localfs ((`path`=`asterix_nc1://data/tinysocial/fbu.adm`),(`format`=`adm`));
+
+load dataset FacebookUsers2 using localfs ((`path`=`asterix_nc1://data/tinysocial/fbu.adm`),(`format`=`adm`));
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.4.query.sqlpp
new file mode 100644
index 0000000..f39cddd
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_pairs-2/object_pairs.4.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE TinySocial;
+
+SELECT kv.name, COUNT(*) values
+FROM FacebookUsers2 fu, fu.employment emp, OBJECT_PAIRS(emp) kv
+GROUP BY kv.name
+ORDER BY values, kv.name;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.1.ddl.sqlpp
index b3dafba..c8b4024 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.1.ddl.sqlpp
@@ -44,6 +44,13 @@
`message-text` : string
};
+create type TinySocial.TweetMessageType2 as {
+ tweetid : string,
+ user : TwitterUserType?
+};
+
create dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
create dataset TweetMessages(TweetMessageType) primary key tweetid;
+
+create dataset TweetMessages2(TweetMessageType2) primary key tweetid;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.2.update.sqlpp
index 2d03f92..a47cf63 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.2.update.sqlpp
@@ -27,3 +27,5 @@
load dataset TwitterUsers using localfs ((`path`=`asterix_nc1://data/tinysocial/twu.adm`),(`format`=`adm`));
load dataset TweetMessages using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
+
+load dataset TweetMessages2 using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.3.query.sqlpp
index f7eabc3..167e8e0 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_remove/object_remove.3.query.sqlpp
@@ -47,5 +47,18 @@
select value object_remove(m, "user")
from TweetMessages as m
order by m.tweetid
+ ),
+
+ /* nullable/missable type */
+ "t7": (
+ select value object_remove(m.user, "lang")
+ from TweetMessages2 as m
+ order by m.tweetid
+ ),
+
+ "t8": (
+ select value object_remove(object_remove( object_remove(u, "lang"), "friends_count"), "statuses_count")
+ from TwitterUsers u
+ limit 1
)
};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.1.ddl.sqlpp
index f6710f4..f3519ac 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.1.ddl.sqlpp
@@ -44,6 +44,13 @@
`message-text` : string
};
+create type TinySocial.TweetMessageType2 as {
+ tweetid : string,
+ user : TwitterUserType?
+};
+
create dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
create dataset TweetMessages(TweetMessageType) primary key tweetid;
+
+create dataset TweetMessages2(TweetMessageType2) primary key tweetid;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.2.update.sqlpp
index 5457dc9..c1e23e2 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.2.update.sqlpp
@@ -27,3 +27,5 @@
load dataset TwitterUsers using localfs ((`path`=`asterix_nc1://data/tinysocial/twu.adm`),(`format`=`adm`));
load dataset TweetMessages using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
+
+load dataset TweetMessages2 using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.3.query.sqlpp
index 5f74fc1..142552a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_rename/object_rename.3.query.sqlpp
@@ -48,5 +48,13 @@
from TweetMessages as m
order by m.tweetid
limit 1
+ ),
+
+ /* nullable/missable type */
+ "t7": (
+ select value object_rename(m.user, "lang", "language")
+ from TweetMessages2 as m
+ order by m.tweetid
+ limit 1
)
};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.1.ddl.sqlpp
index 1aba6e0..0a1f542 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.1.ddl.sqlpp
@@ -35,4 +35,15 @@
statuses_count : bigint
};
-create dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
\ No newline at end of file
+create type recordType as {
+ f : int
+};
+
+create type dsType as closed {
+ id: int,
+ rec_f : recordType?
+};
+
+create dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
+
+create dataset ds(dsType) primary key id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.2.update.sqlpp
index 8f854e3..7528356 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.2.update.sqlpp
@@ -24,4 +24,6 @@
use TinySocial;
-load dataset TwitterUsers using localfs ((`path`=`asterix_nc1://data/tinysocial/twu.adm`),(`format`=`adm`));
\ No newline at end of file
+load dataset TwitterUsers using localfs ((`path`=`asterix_nc1://data/tinysocial/twu.adm`),(`format`=`adm`));
+
+insert into ds ({"id": 1, "rec_f": {"f": 2} });
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.4.query.sqlpp
new file mode 100644
index 0000000..ad4fe11
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.4.query.sqlpp
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * Description : Testing object_unwrap under different queries.
+ * Expected Res : Success
+ */
+
+use TinySocial;
+
+select object_unwrap(o) from (
+ select lang
+ from TwitterUsers u
+ order by lang
+ limit 1
+) o;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.5.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.5.query.sqlpp
new file mode 100644
index 0000000..ebff0c8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.5.query.sqlpp
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * Description : Testing object_unwrap under different queries.
+ * Expected Res : Success
+ */
+
+use TinySocial;
+
+select object_unwrap(d.rec_f)
+from ds d;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.4.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.6.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.4.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_unwrap/object_unwarp.6.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.1.ddl.sqlpp
index 1242661..22a7e71 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.1.ddl.sqlpp
@@ -44,6 +44,13 @@
`message-text` : string
};
+create type TinySocial.TweetMessageType2 as {
+ tweetid : string,
+ user : TwitterUserType?
+};
+
create dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
create dataset TweetMessages(TweetMessageType) primary key tweetid;
+
+create dataset TweetMessages2(TweetMessageType2) primary key tweetid;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.2.update.sqlpp
index 72edf0c..0c78212 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.2.update.sqlpp
@@ -27,3 +27,5 @@
load dataset TwitterUsers using localfs ((`path`=`asterix_nc1://data/tinysocial/twu.adm`),(`format`=`adm`));
load dataset TweetMessages using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
+
+load dataset TweetMessages2 using localfs ((`path`=`asterix_nc1://data/tinysocial/twm.adm`),(`format`=`adm`));
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.3.query.sqlpp
index ebd0a80..8c2f2ab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/objects/object_values/object_values.3.query.sqlpp
@@ -46,5 +46,13 @@
from TweetMessages as m
order by m.tweetid
limit 1
+ ),
+
+ /* nullable/missable type */
+ "t5": (
+ select value object_values(m.user)
+ from TweetMessages2 as m
+ order by m.tweetid
+ limit 1
)
};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-field-value/tiny-social-example/tiny-social-example.5.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-field-value/tiny-social-example/tiny-social-example.5.adm
new file mode 100644
index 0000000..b726919
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-field-value/tiny-social-example/tiny-social-example.5.adm
@@ -0,0 +1 @@
+"NathanGiesen@211"
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.04.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.4.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.04.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.05.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.5.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.05.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.06.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.6.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.06.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.07.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.7.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.07.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.08.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.8.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.08.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.09.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.9.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.09.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.10.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.10.adm
new file mode 100644
index 0000000..2e49bb4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.10.adm
@@ -0,0 +1 @@
+[ { "field-name": "screen-name", "field-type": "string", "is-open": false }, { "field-name": "lang", "field-type": "string", "is-open": false }, { "field-name": "friends_count", "field-type": "bigint", "is-open": false }, { "field-name": "statuses_count", "field-type": "bigint", "is-open": false }, { "field-name": "name", "field-type": "string", "is-open": true }, { "field-name": "followers_count", "field-type": "bigint", "is-open": true } ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_length/object_length.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_length/object_length.3.adm
index f03b7d5..815cdca 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_length/object_length.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_length/object_length.3.adm
@@ -1 +1 @@
-{ "t1": [ true, true, true, true, true ], "t2": [ 0, 1, 2 ], "t3": [ 2, 2, 2 ], "t4": [ 6 ], "t5": [ 6 ] }
\ No newline at end of file
+{ "t1": [ true, true, true, true, true ], "t2": [ 0, 1, 2 ], "t3": [ 2, 2, 2 ], "t4": [ 6 ], "t5": [ 6 ], "t6": [ 6 ] }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_names/object_names.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_names/object_names.3.adm
index 04441f8..03fd77d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_names/object_names.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_names/object_names.3.adm
@@ -1 +1 @@
-{ "t1": [ true, true, true, true, true ], "t2": [ [ ], [ "a" ], [ "a", "b" ], [ "a", "b", "c" ] ], "t3": [ [ "x", "y" ], [ "x", "y" ], [ "x", "y" ] ], "t4": [ { "res": "followers_count,friends_count,lang,name,screen-name,statuses_count" } ], "t5": [ { "res": "message-text,referred-topics,send-time,sender-location,tweetid,user" } ] }
\ No newline at end of file
+{ "t1": [ true, true, true, true, true ], "t2": [ [ ], [ "a" ], [ "a", "b" ], [ "a", "b", "c" ] ], "t3": [ [ "x", "y" ], [ "x", "y" ], [ "x", "y" ] ], "t4": [ { "res": "followers_count,friends_count,lang,name,screen-name,statuses_count" } ], "t5": [ { "res": "message-text,referred-topics,send-time,sender-location,tweetid,user" } ], "t6": [ { "res": "followers_count,friends_count,lang,name,screen-name,statuses_count" } ] }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_pairs-2/object_pairs-2.2.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_pairs-2/object_pairs-2.2.adm
new file mode 100644
index 0000000..65692e8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_pairs-2/object_pairs-2.2.adm
@@ -0,0 +1,3 @@
+{ "values": 3, "name": "end-date" }
+{ "values": 10, "name": "organization-name" }
+{ "values": 10, "name": "start-date" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_remove/object_remove.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_remove/object_remove.3.adm
index 61d0506..7ff6e89 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_remove/object_remove.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_remove/object_remove.3.adm
@@ -1 +1 @@
-{ "t1": [ true, true, true, true ], "t2": { "b": 2 }, "t3": { "a": 1 }, "t4": { "a": 1, "b": 2 }, "t5": [ { "screen-name": "ChangEwing_573", "friends_count": 182, "statuses_count": 394, "name": "Chang Ewing", "followers_count": 32136 }, { "screen-name": "ColineGeyer@63", "friends_count": 121, "statuses_count": 362, "name": "Coline Geyer", "followers_count": 17159 }, { "screen-name": "NathanGiesen@211", "friends_count": 18, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, { "screen-name": "NilaMilliron_tw", "friends_count": 445, "statuses_count": 164, "name": "Nila Milliron", "followers_count": 22649 } ], "t6": [ { "tweetid": "1", "sender-location": point("47.44,80.65"), "send-time": datetime("2008-04-26T10:10:00.000Z"), "referred-topics": {{ "t-mobile", "customization" }}, "message-text": " love t-mobile its customization is good:)" }, { "tweetid": "10", "sender-location": point("29.15,76.53"), "send-time": datetime("2008-01-26T10:10:00.000Z"), "referred-topics": {{ "verizon", "voice-clarity" }}, "message-text": " hate verizon its voice-clarity is OMG:(" }, { "tweetid": "11", "sender-location": point("37.59,68.42"), "send-time": datetime("2008-03-09T10:10:00.000Z"), "referred-topics": {{ "iphone", "platform" }}, "message-text": " can't stand iphone its platform is terrible" }, { "tweetid": "12", "sender-location": point("24.82,94.63"), "send-time": datetime("2010-02-13T10:10:00.000Z"), "referred-topics": {{ "samsung", "voice-command" }}, "message-text": " like samsung the voice-command is amazing:)" }, { "tweetid": "2", "sender-location": point("32.84,67.14"), "send-time": datetime("2010-05-13T10:10:00.000Z"), "referred-topics": {{ "verizon", "shortcut-menu" }}, "message-text": " like verizon its shortcut-menu is awesome:)" }, { "tweetid": "3", "sender-location": point("29.72,75.8"), "send-time": datetime("2006-11-04T10:10:00.000Z"), "referred-topics": {{ "motorola", "speed" }}, "message-text": " like motorola the speed is good:)" }, { "tweetid": "4", "sender-location": point("39.28,70.48"), "send-time": datetime("2011-12-26T10:10:00.000Z"), "referred-topics": {{ "sprint", "voice-command" }}, "message-text": " like sprint the voice-command is mind-blowing:)" }, { "tweetid": "5", "sender-location": point("40.09,92.69"), "send-time": datetime("2006-08-04T10:10:00.000Z"), "referred-topics": {{ "motorola", "speed" }}, "message-text": " can't stand motorola its speed is terrible:(" }, { "tweetid": "6", "sender-location": point("47.51,83.99"), "send-time": datetime("2010-05-07T10:10:00.000Z"), "referred-topics": {{ "iphone", "voice-clarity" }}, "message-text": " like iphone the voice-clarity is good:)" }, { "tweetid": "7", "sender-location": point("36.21,72.6"), "send-time": datetime("2011-08-25T10:10:00.000Z"), "referred-topics": {{ "samsung", "platform" }}, "message-text": " like samsung the platform is good" }, { "tweetid": "8", "sender-location": point("46.05,93.34"), "send-time": datetime("2005-10-14T10:10:00.000Z"), "referred-topics": {{ "t-mobile", "shortcut-menu" }}, "message-text": " like t-mobile the shortcut-menu is awesome:)" }, { "tweetid": "9", "sender-location": point("36.86,74.62"), "send-time": datetime("2012-07-21T10:10:00.000Z"), "referred-topics": {{ "verizon", "voicemail-service" }}, "message-text": " love verizon its voicemail-service is awesome" } ] }
\ No newline at end of file
+{ "t1": [ true, true, true, true ], "t2": { "b": 2 }, "t3": { "a": 1 }, "t4": { "a": 1, "b": 2 }, "t5": [ { "screen-name": "ChangEwing_573", "friends_count": 182, "statuses_count": 394, "name": "Chang Ewing", "followers_count": 32136 }, { "screen-name": "ColineGeyer@63", "friends_count": 121, "statuses_count": 362, "name": "Coline Geyer", "followers_count": 17159 }, { "screen-name": "NathanGiesen@211", "friends_count": 18, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, { "screen-name": "NilaMilliron_tw", "friends_count": 445, "statuses_count": 164, "name": "Nila Milliron", "followers_count": 22649 } ], "t6": [ { "tweetid": "1", "sender-location": point("47.44,80.65"), "send-time": datetime("2008-04-26T10:10:00.000Z"), "referred-topics": {{ "t-mobile", "customization" }}, "message-text": " love t-mobile its customization is good:)" }, { "tweetid": "10", "sender-location": point("29.15,76.53"), "send-time": datetime("2008-01-26T10:10:00.000Z"), "referred-topics": {{ "verizon", "voice-clarity" }}, "message-text": " hate verizon its voice-clarity is OMG:(" }, { "tweetid": "11", "sender-location": point("37.59,68.42"), "send-time": datetime("2008-03-09T10:10:00.000Z"), "referred-topics": {{ "iphone", "platform" }}, "message-text": " can't stand iphone its platform is terrible" }, { "tweetid": "12", "sender-location": point("24.82,94.63"), "send-time": datetime("2010-02-13T10:10:00.000Z"), "referred-topics": {{ "samsung", "voice-command" }}, "message-text": " like samsung the voice-command is amazing:)" }, { "tweetid": "2", "sender-location": point("32.84,67.14"), "send-time": datetime("2010-05-13T10:10:00.000Z"), "referred-topics": {{ "verizon", "shortcut-menu" }}, "message-text": " like verizon its shortcut-menu is awesome:)" }, { "tweetid": "3", "sender-location": point("29.72,75.8"), "send-time": datetime("2006-11-04T10:10:00.000Z"), "referred-topics": {{ "motorola", "speed" }}, "message-text": " like motorola the speed is good:)" }, { "tweetid": "4", "sender-location": point("39.28,70.48"), "send-time": datetime("2011-12-26T10:10:00.000Z"), "referred-topics": {{ "sprint", "voice-command" }}, "message-text": " like sprint the voice-command is mind-blowing:)" }, { "tweetid": "5", "sender-location": point("40.09,92.69"), "send-time": datetime("2006-08-04T10:10:00.000Z"), "referred-topics": {{ "motorola", "speed" }}, "message-text": " can't stand motorola its speed is terrible:(" }, { "tweetid": "6", "sender-location": point("47.51,83.99"), "send-time": datetime("2010-05-07T10:10:00.000Z"), "referred-topics": {{ "iphone", "voice-clarity" }}, "message-text": " like iphone the voice-clarity is good:)" }, { "tweetid": "7", "sender-location": point("36.21,72.6"), "send-time": datetime("2011-08-25T10:10:00.000Z"), "referred-topics": {{ "samsung", "platform" }}, "message-text": " like samsung the platform is good" }, { "tweetid": "8", "sender-location": point("46.05,93.34"), "send-time": datetime("2005-10-14T10:10:00.000Z"), "referred-topics": {{ "t-mobile", "shortcut-menu" }}, "message-text": " like t-mobile the shortcut-menu is awesome:)" }, { "tweetid": "9", "sender-location": point("36.86,74.62"), "send-time": datetime("2012-07-21T10:10:00.000Z"), "referred-topics": {{ "verizon", "voicemail-service" }}, "message-text": " love verizon its voicemail-service is awesome" } ], "t7": [ { "screen-name": "NathanGiesen@211", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, { "screen-name": "ColineGeyer@63", "friends_count": 121, "statuses_count": 362, "name": "Coline Geyer", "followers_count": 17159 }, { "screen-name": "NilaMilliron_tw", "friends_count": 445, "statuses_count": 164, "name": "Nila Milliron", "followers_count": 22649 }, { "screen-name": "OliJackson_512", "friends_count": 445, "statuses_count": 164, "name": "Oli Jackson", "followers_count": 22649 }, { "screen-name": "ColineGeyer@63", "friends_count": 121, "statuses_count": 362, "name": "Coline Geyer", "followers_count": 17159 }, { "screen-name": "NathanGiesen@211", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, { "screen-name": "NathanGiesen@211", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, { "screen-name": "NathanGiesen@211", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, { "screen-name": "ColineGeyer@63", "friends_count": 121, "statuses_count": 362, "name": "Coline Geyer", "followers_count": 17159 }, { "screen-name": "ChangEwing_573", "friends_count": 182, "statuses_count": 394, "name": "Chang Ewing", "followers_count": 32136 }, { "screen-name": "NathanGiesen@211", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, { "screen-name": "NathanGiesen@211", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 } ], "t8": [ { "screen-name": "ChangEwing_573", "name": "Chang Ewing", "followers_count": 32136 } ] }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_rename/object_rename.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_rename/object_rename.3.adm
index 197fec1..16c2c6d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_rename/object_rename.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_rename/object_rename.3.adm
@@ -1 +1 @@
-{ "t1": [ true, true, true, true ], "t2": { "a": 1, "c": 2 }, "t3": { "a": 1, "b": 2 }, "t5": [ { "screen-name": "ChangEwing_573", "language": "en", "friends_count": 182, "statuses_count": 394, "name": "Chang Ewing", "followers_count": 32136 } ], "t6": [ { "tweetid": "1", "user_details": { "screen-name": "NathanGiesen@211", "lang": "en", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, "sender-location": point("47.44,80.65"), "send-time": datetime("2008-04-26T10:10:00.000Z"), "referred-topics": {{ "t-mobile", "customization" }}, "message-text": " love t-mobile its customization is good:)" } ] }
\ No newline at end of file
+{ "t1": [ true, true, true, true ], "t2": { "a": 1, "c": 2 }, "t3": { "a": 1, "b": 2 }, "t5": [ { "screen-name": "ChangEwing_573", "language": "en", "friends_count": 182, "statuses_count": 394, "name": "Chang Ewing", "followers_count": 32136 } ], "t6": [ { "tweetid": "1", "user_details": { "screen-name": "NathanGiesen@211", "lang": "en", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, "sender-location": point("47.44,80.65"), "send-time": datetime("2008-04-26T10:10:00.000Z"), "referred-topics": {{ "t-mobile", "customization" }}, "message-text": " love t-mobile its customization is good:)" } ], "t7": [ { "screen-name": "NathanGiesen@211", "language": "en", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 } ] }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_unwrap/object_unwrap.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_unwrap/object_unwrap.4.adm
new file mode 100644
index 0000000..868480b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_unwrap/object_unwrap.4.adm
@@ -0,0 +1 @@
+{ "$1": "en" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_unwrap/object_unwrap.5.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_unwrap/object_unwrap.5.adm
new file mode 100644
index 0000000..cd2a127
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_unwrap/object_unwrap.5.adm
@@ -0,0 +1 @@
+{ "$1": 2 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_values/object_values.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_values/object_values.3.adm
index 2216760..d2a50b7 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_values/object_values.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/objects/object_values/object_values.3.adm
@@ -1 +1 @@
-{ "t1": [ true, true, true ], "t2": [ { "a": 3 }, [ 1, 2 ], 4 ], "t3": [ [ "ChangEwing_573", "en", 182, 394, "Chang Ewing", 32136 ] ], "t4": [ [ "1", { "screen-name": "NathanGiesen@211", "lang": "en", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, point("47.44,80.65"), datetime("2008-04-26T10:10:00.000Z"), {{ "t-mobile", "customization" }}, " love t-mobile its customization is good:)" ] ] }
\ No newline at end of file
+{ "t1": [ true, true, true ], "t2": [ { "a": 3 }, [ 1, 2 ], 4 ], "t3": [ [ "ChangEwing_573", "en", 182, 394, "Chang Ewing", 32136 ] ], "t4": [ [ "1", { "screen-name": "NathanGiesen@211", "lang": "en", "friends_count": 39339, "statuses_count": 473, "name": "Nathan Giesen", "followers_count": 49416 }, point("47.44,80.65"), datetime("2008-04-26T10:10:00.000Z"), {{ "t-mobile", "customization" }}, " love t-mobile its customization is good:)" ] ], "t5": [ [ "NathanGiesen@211", "en", 39339, 473, "Nathan Giesen", 49416 ] ] }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.1.ast
index 2ab67ab..0f0e66f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.1.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.1.ast
@@ -48,3 +48,14 @@
message : string
}
]
+TypeDecl TweetMessageType2 [
+ open RecordType {
+ tweetid : string,
+ user : TwitterUserType?,
+ sender-location : point?,
+ send-time : datetime,
+ referred-topics : UnorderedList <string>
+,
+ message-text : string
+ }
+]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.2.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.2.ast
index a6e2ec9..4971038 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.2.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.2.ast
@@ -3,3 +3,4 @@
DatasetDecl FacebookMessages(FacebookMessageType) partitioned by [[message-id]]
DatasetDecl TwitterUsers(TwitterUserType) partitioned by [[screen-name]]
DatasetDecl TweetMessages(TweetMessageType) partitioned by [[tweetid]]
+DatasetDecl TweetMessages2(TweetMessageType2) partitioned by [[tweetid]]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.5.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.5.ast
new file mode 100644
index 0000000..6b1c326
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-field-value/tiny-social-example/tiny-social-example.5.ast
@@ -0,0 +1,25 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+FunctionCall TinySocial.get-object-field-value@2[
+ FieldAccessor [
+ Variable [ Name=$m ]
+ Field=user
+ ]
+ LiteralExpr [STRING] [screen-name]
+]
+]
+FROM [ FunctionCall asterix.dataset@1[
+ LiteralExpr [STRING] [TinySocial.TweetMessages2]
+ ]
+ AS Variable [ Name=$m ]
+]
+Where
+ OperatorExpr [
+ FieldAccessor [
+ Variable [ Name=$m ]
+ Field=tweetid
+ ]
+ =
+ LiteralExpr [STRING] [1]
+ ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ast
index 04257fc..1fc5c4f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.1.ast
@@ -88,3 +88,14 @@
message : string
}
]
+TypeDecl TweetMessageType2 [
+ open RecordType {
+ tweetid : string,
+ user : TwitterUserType?,
+ sender-location : point?,
+ send-time : datetime,
+ referred-topics : UnorderedList <string>
+,
+ message-text : string
+ }
+]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.10.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.10.ast
new file mode 100644
index 0000000..e6b376b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.10.ast
@@ -0,0 +1,24 @@
+DataverseUse TinySocial
+Query:
+SELECT ELEMENT [
+FunctionCall TinySocial.get-object-fields@1[
+ FieldAccessor [
+ Variable [ Name=$message ]
+ Field=user
+ ]
+]
+]
+FROM [ FunctionCall asterix.dataset@1[
+ LiteralExpr [STRING] [TinySocial.TweetMessages2]
+ ]
+ AS Variable [ Name=$message ]
+]
+Where
+ OperatorExpr [
+ FieldAccessor [
+ Variable [ Name=$message ]
+ Field=tweetid
+ ]
+ =
+ LiteralExpr [STRING] [1]
+ ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ast
index a2fb376..3766a9d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/objects/get-object-fields/tiny-social-example-only-records/tiny-social-example-only-records.2.ast
@@ -3,7 +3,8 @@
DatasetDecl FacebookMessages(FacebookMessageType) partitioned by [[message-id]]
DatasetDecl TwitterUsers(TwitterUserType) partitioned by [[screen-name]]
DatasetDecl TweetMessages(TweetMessageType) partitioned by [[tweetid]]
+DatasetDecl TweetMessages2(TweetMessageType2) partitioned by [[tweetid]]
DatasetDecl FacebookUsersAlternate(FacebookUserAlternateType) partitioned by [[id]]
DatasetDecl FacebookMessagesAlternate(FacebookMessageAlternateType) partitioned by [[message-id]]
DatasetDecl TwitterUsersAlternate(TwitterUserAlternateType) partitioned by [[screen-name]]
-DatasetDecl TweetMessagesAlternate(TweetMessageAlternateType) partitioned by [[tweetid]]
+DatasetDecl TweetMessagesAlternate(TweetMessageAlternateType) partitioned by [[tweetid]]
\ No newline at end of file
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java
index b9c58c7..a002858 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java
@@ -160,6 +160,7 @@
listFieldPath.add(((AString) fieldPath.getItem(i)).getStringValue());
}
+ // TODO(ali): I guess this may not work as well if t happens to be UNION(record), not sure if it ever does
switch (t.getTypeTag()) {
case OBJECT: {
fd.setImmutableStates(t, listFieldPath);
@@ -191,7 +192,7 @@
public void infer(ILogicalExpression expr, IFunctionDescriptor fd, IVariableTypeEnvironment context,
CompilerProperties compilerProps) throws AlgebricksException {
AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expr;
- IAType t = (IAType) context.getType(fce.getArguments().get(0).getValue());
+ IAType t = TypeComputeUtils.getActualType((IAType) context.getType(fce.getArguments().get(0).getValue()));
ATypeTag typeTag = t.getTypeTag();
switch (typeTag) {
case OBJECT: {