This is an automated email from the ASF dual-hosted git repository.
wyk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
The following commit(s) were added to refs/heads/master by this push:
new ac1b415e99 [ASTERIXDB-3087][COMP] Remove
allPossibleAdditionalFieldNames from deepEqual
ac1b415e99 is described below
commit ac1b415e9982d05e1855584b6df76001a1bd79aa
Author: Wail Alkowaileet <[email protected]>
AuthorDate: Fri Nov 18 08:52:55 2022 -0800
[ASTERIXDB-3087][COMP] Remove allPossibleAdditionalFieldNames from deepEqual
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
Remove the comparison of allPossibleAdditionalFieldNames in deepEqual
in ARecordType as it is not part of the actual type. This fixes the
issue of introducing unnecessary casts.
Change-Id: Ia45d224fd8dfec062c752bdfd47357cca6cd038f
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17279
Integration-Tests: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
Reviewed-by: Wail Alkowaileet <[email protected]>
Reviewed-by: Ali Alsuliman <[email protected]>
---
.../union_type_cast/union_type_cast.1.ddl.sqlpp | 51 +++++++++++++++
.../union_type_cast/union_type_cast.2.update.sqlpp | 24 ++++++++
.../union_type_cast/union_type_cast.3.query.sqlpp | 33 ++++++++++
.../union_type_cast/union_type_cast.4.query.sqlpp | 36 +++++++++++
.../union/union_type_cast/union_type_cast.3.adm | 40 ++++++++++++
.../union/union_type_cast/union_type_cast.4.adm | 72 ++++++++++++++++++++++
.../test/resources/runtimets/testsuite_sqlpp.xml | 5 ++
.../org/apache/asterix/om/types/ARecordType.java | 61 ++++++------------
8 files changed, 280 insertions(+), 42 deletions(-)
diff --git
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.1.ddl.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.1.ddl.sqlpp
new file mode 100644
index 0000000000..2a616ea38f
--- /dev/null
+++
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.1.ddl.sqlpp
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+DROP DATAVERSE TinySocial IF EXISTS;
+CREATE DATAVERSE TinySocial;
+
+USE TinySocial;
+
+CREATE TYPE EmploymentType AS CLOSED
+{
+ `organization-name` : string,
+ `start-date` : date,
+ `end-date` : date?
+};
+
+CREATE TYPE FacebookUserType AS CLOSED {
+ id : bigint,
+ alias : string,
+ name : string,
+ `user-since` : datetime,
+ `friend-ids` : {{bigint}},
+ employment : [EmploymentType]
+};
+
+CREATE TYPE FacebookMessageType AS CLOSED {
+ `message-id` : bigint,
+ `author-id` : bigint,
+ `in-response-to` : bigint?,
+ `sender-location` : point?,
+ message : string
+};
+
+CREATE DATASET FacebookUsers(FacebookUserType) PRIMARY KEY id;
+
+CREATE DATASET FacebookMessages(FacebookMessageType) PRIMARY KEY `message-id`;
diff --git
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.2.update.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.2.update.sqlpp
new file mode 100644
index 0000000000..3d785ada65
--- /dev/null
+++
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.2.update.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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;
+
+LOAD DATASET FacebookUsers using localfs
(("path"="asterix_nc1://data/tinysocial/fbu.adm"),("format"="adm"));
+
+LOAD DATASET FacebookMessages using localfs
(("path"="asterix_nc1://data/tinysocial/fbm.adm"),("format"="adm"));
diff --git
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.3.query.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.3.query.sqlpp
new file mode 100644
index 0000000000..003ec26965
--- /dev/null
+++
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.3.query.sqlpp
@@ -0,0 +1,33 @@
+/*
+ * 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;
+-- Disabled for a simpler plan
+SET `compiler.sort.parallel` "false";
+
+
+ SELECT "message1" ds, s.`message-id` id, object_remove(s,
"in-response-to") no_in_response_to
+ FROM FacebookMessages AS s
+UNION ALL
+ SELECT "user" ds, t.id id, t user
+ FROM FacebookUsers t
+UNION ALL
+ SELECT "message2" ds, s.`message-id` id, object_remove(s, "author-id")
no_author_id
+ FROM FacebookMessages s
+ORDER BY id, ds;
diff --git
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.4.query.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.4.query.sqlpp
new file mode 100644
index 0000000000..cc63b57dc0
--- /dev/null
+++
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_type_cast/union_type_cast.4.query.sqlpp
@@ -0,0 +1,36 @@
+/*
+ * 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;
+-- Disabled for a simpler plan
+SET `compiler.sort.parallel` "false";
+
+-- To prevent the plan from changing
+SET `compiler.parallelism` "0";
+
+EXPLAIN
+ SELECT s.`message-id` id, object_remove(s, "in-response-to")
no_in_response_to
+ FROM FacebookMessages AS s
+UNION ALL
+ SELECT t.id id, t user
+ FROM FacebookUsers t
+UNION ALL
+ SELECT s.`message-id` id, object_remove(s, "author-id") no_author_id
+ FROM FacebookMessages s
+ORDER BY id;
diff --git
a/asterixdb/asterix-app/src/test/resources/runtimets/results/union/union_type_cast/union_type_cast.3.adm
b/asterixdb/asterix-app/src/test/resources/runtimets/results/union/union_type_cast/union_type_cast.3.adm
new file mode 100644
index 0000000000..cefb9461d6
--- /dev/null
+++
b/asterixdb/asterix-app/src/test/resources/runtimets/results/union/union_type_cast/union_type_cast.3.adm
@@ -0,0 +1,40 @@
+{ "ds": "message1", "id": 1, "no_in_response_to": { "message-id": 1,
"author-id": 3, "sender-location": point("47.16,77.75"), "message": " love
sprint its shortcut-menu is awesome:)" } }
+{ "ds": "message2", "id": 1, "no_author_id": { "message-id": 1,
"in-response-to": 2, "sender-location": point("47.16,77.75"), "message": " love
sprint its shortcut-menu is awesome:)" } }
+{ "ds": "user", "id": 1, "user": { "id": 1, "alias": "Margarita", "name":
"MargaritaStoddard", "user-since": datetime("2012-08-20T10:10:00.000"),
"friend-ids": {{ 2, 3, 6, 10 }}, "employment": [ { "organization-name":
"Codetechno", "start-date": date("2006-08-06") } ] } }
+{ "ds": "message1", "id": 2, "no_in_response_to": { "message-id": 2,
"author-id": 1, "sender-location": point("41.66,80.87"), "message": " dislike
iphone its touch-screen is horrible" } }
+{ "ds": "message2", "id": 2, "no_author_id": { "message-id": 2,
"in-response-to": 4, "sender-location": point("41.66,80.87"), "message": "
dislike iphone its touch-screen is horrible" } }
+{ "ds": "user", "id": 2, "user": { "id": 2, "alias": "Isbel", "name":
"IsbelDull", "user-since": datetime("2011-01-22T10:10:00.000"), "friend-ids":
{{ 1, 4 }}, "employment": [ { "organization-name": "Hexviafind", "start-date":
date("2010-04-27") } ] } }
+{ "ds": "message1", "id": 3, "no_in_response_to": { "message-id": 3,
"author-id": 2, "sender-location": point("48.09,81.01"), "message": " like
samsung the plan is amazing" } }
+{ "ds": "message2", "id": 3, "no_author_id": { "message-id": 3,
"in-response-to": 4, "sender-location": point("48.09,81.01"), "message": " like
samsung the plan is amazing" } }
+{ "ds": "user", "id": 3, "user": { "id": 3, "alias": "Emory", "name":
"EmoryUnk", "user-since": datetime("2012-07-10T10:10:00.000"), "friend-ids": {{
1, 5, 8, 9 }}, "employment": [ { "organization-name": "geomedia", "start-date":
date("2010-06-17"), "end-date": date("2010-01-26") } ] } }
+{ "ds": "message1", "id": 4, "no_in_response_to": { "message-id": 4,
"author-id": 1, "sender-location": point("37.73,97.04"), "message": " can't
stand at&t the network is horrible:(" } }
+{ "ds": "message2", "id": 4, "no_author_id": { "message-id": 4,
"in-response-to": 2, "sender-location": point("37.73,97.04"), "message": "
can't stand at&t the network is horrible:(" } }
+{ "ds": "user", "id": 4, "user": { "id": 4, "alias": "Nicholas", "name":
"NicholasStroh", "user-since": datetime("2010-12-27T10:10:00.000"),
"friend-ids": {{ 2 }}, "employment": [ { "organization-name": "Zamcorporation",
"start-date": date("2010-06-08") } ] } }
+{ "ds": "message1", "id": 5, "no_in_response_to": { "message-id": 5,
"author-id": 6, "sender-location": point("34.7,90.76"), "message": " love
sprint the customization is mind-blowing" } }
+{ "ds": "message2", "id": 5, "no_author_id": { "message-id": 5,
"in-response-to": 2, "sender-location": point("34.7,90.76"), "message": " love
sprint the customization is mind-blowing" } }
+{ "ds": "user", "id": 5, "user": { "id": 5, "alias": "Von", "name":
"VonKemble", "user-since": datetime("2010-01-05T10:10:00.000"), "friend-ids":
{{ 3, 6, 10 }}, "employment": [ { "organization-name": "Kongreen",
"start-date": date("2010-11-27") } ] } }
+{ "ds": "message1", "id": 6, "no_in_response_to": { "message-id": 6,
"author-id": 2, "sender-location": point("31.5,75.56"), "message": " like
t-mobile its platform is mind-blowing" } }
+{ "ds": "message2", "id": 6, "no_author_id": { "message-id": 6,
"in-response-to": 1, "sender-location": point("31.5,75.56"), "message": " like
t-mobile its platform is mind-blowing" } }
+{ "ds": "user", "id": 6, "user": { "id": 6, "alias": "Willis", "name":
"WillisWynne", "user-since": datetime("2005-01-17T10:10:00.000"), "friend-ids":
{{ 1, 3, 7 }}, "employment": [ { "organization-name": "jaydax", "start-date":
date("2009-05-15") } ] } }
+{ "ds": "message1", "id": 7, "no_in_response_to": { "message-id": 7,
"author-id": 5, "sender-location": point("32.91,85.05"), "message": " dislike
sprint the speed is horrible" } }
+{ "ds": "message2", "id": 7, "no_author_id": { "message-id": 7,
"in-response-to": 15, "sender-location": point("32.91,85.05"), "message": "
dislike sprint the speed is horrible" } }
+{ "ds": "user", "id": 7, "user": { "id": 7, "alias": "Suzanna", "name":
"SuzannaTillson", "user-since": datetime("2012-08-07T10:10:00.000"),
"friend-ids": {{ 6 }}, "employment": [ { "organization-name": "Labzatron",
"start-date": date("2011-04-19") } ] } }
+{ "ds": "message1", "id": 8, "no_in_response_to": { "message-id": 8,
"author-id": 1, "sender-location": point("40.33,80.87"), "message": " like
verizon the 3G is awesome:)" } }
+{ "ds": "message2", "id": 8, "no_author_id": { "message-id": 8,
"in-response-to": 11, "sender-location": point("40.33,80.87"), "message": "
like verizon the 3G is awesome:)" } }
+{ "ds": "user", "id": 8, "user": { "id": 8, "alias": "Nila", "name":
"NilaMilliron", "user-since": datetime("2008-01-01T10:10:00.000"),
"friend-ids": {{ 3 }}, "employment": [ { "organization-name": "Plexlane",
"start-date": date("2010-02-28") } ] } }
+{ "ds": "message1", "id": 9, "no_in_response_to": { "message-id": 9,
"author-id": 3, "sender-location": point("34.45,96.48"), "message": " love
verizon its wireless is good" } }
+{ "ds": "message2", "id": 9, "no_author_id": { "message-id": 9,
"in-response-to": 12, "sender-location": point("34.45,96.48"), "message": "
love verizon its wireless is good" } }
+{ "ds": "user", "id": 9, "user": { "id": 9, "alias": "Woodrow", "name":
"WoodrowNehling", "user-since": datetime("2005-09-20T10:10:00.000"),
"friend-ids": {{ 3, 10 }}, "employment": [ { "organization-name": "Zuncan",
"start-date": date("2003-04-22"), "end-date": date("2009-12-13") } ] } }
+{ "ds": "message1", "id": 10, "no_in_response_to": { "message-id": 10,
"author-id": 1, "sender-location": point("42.5,70.01"), "message": " can't
stand motorola the touch-screen is terrible" } }
+{ "ds": "message2", "id": 10, "no_author_id": { "message-id": 10,
"in-response-to": 12, "sender-location": point("42.5,70.01"), "message": "
can't stand motorola the touch-screen is terrible" } }
+{ "ds": "user", "id": 10, "user": { "id": 10, "alias": "Bram", "name":
"BramHatch", "user-since": datetime("2010-10-16T10:10:00.000"), "friend-ids":
{{ 1, 5, 9 }}, "employment": [ { "organization-name": "physcane", "start-date":
date("2007-06-05"), "end-date": date("2011-11-05") } ] } }
+{ "ds": "message1", "id": 11, "no_in_response_to": { "message-id": 11,
"author-id": 1, "sender-location": point("38.97,77.49"), "message": " can't
stand at&t its plan is terrible" } }
+{ "ds": "message2", "id": 11, "no_author_id": { "message-id": 11,
"in-response-to": 1, "sender-location": point("38.97,77.49"), "message": "
can't stand at&t its plan is terrible" } }
+{ "ds": "message1", "id": 12, "no_in_response_to": { "message-id": 12,
"author-id": 10, "sender-location": point("42.26,77.76"), "message": " can't
stand t-mobile its voicemail-service is OMG:(" } }
+{ "ds": "message2", "id": 12, "no_author_id": { "message-id": 12,
"in-response-to": 6, "sender-location": point("42.26,77.76"), "message": "
can't stand t-mobile its voicemail-service is OMG:(" } }
+{ "ds": "message1", "id": 13, "no_in_response_to": { "message-id": 13,
"author-id": 10, "sender-location": point("42.77,78.92"), "message": " dislike
iphone the voice-command is bad:(" } }
+{ "ds": "message2", "id": 13, "no_author_id": { "message-id": 13,
"in-response-to": 4, "sender-location": point("42.77,78.92"), "message": "
dislike iphone the voice-command is bad:(" } }
+{ "ds": "message1", "id": 14, "no_in_response_to": { "message-id": 14,
"author-id": 9, "sender-location": point("41.33,85.28"), "message": " love at&t
its 3G is good:)" } }
+{ "ds": "message2", "id": 14, "no_author_id": { "message-id": 14,
"in-response-to": 12, "sender-location": point("41.33,85.28"), "message": "
love at&t its 3G is good:)" } }
+{ "ds": "message1", "id": 15, "no_in_response_to": { "message-id": 15,
"author-id": 7, "sender-location": point("44.47,67.11"), "message": " like
iphone the voicemail-service is awesome" } }
+{ "ds": "message2", "id": 15, "no_author_id": { "message-id": 15,
"in-response-to": 11, "sender-location": point("44.47,67.11"), "message": "
like iphone the voicemail-service is awesome" } }
diff --git
a/asterixdb/asterix-app/src/test/resources/runtimets/results/union/union_type_cast/union_type_cast.4.adm
b/asterixdb/asterix-app/src/test/resources/runtimets/results/union/union_type_cast/union_type_cast.4.adm
new file mode 100644
index 0000000000..b8d5203156
--- /dev/null
+++
b/asterixdb/asterix-app/src/test/resources/runtimets/results/union/union_type_cast/union_type_cast.4.adm
@@ -0,0 +1,72 @@
+distribute result [$#1]
+-- DISTRIBUTE_RESULT |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ project ([$#1])
+ -- STREAM_PROJECT |PARTITIONED|
+ exchange
+ -- SORT_MERGE_EXCHANGE [$$102(ASC) ] |PARTITIONED|
+ order (ASC, $$102)
+ -- STABLE_SORT [$$102(ASC)] |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ union ($$64, $$140, $#1) ($$103, $$70, $$102)
+ -- UNION_ALL |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ union ($$139, $$141, $$64) ($$68, $$69, $$103)
+ -- UNION_ALL |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ project ([$$139, $$68])
+ -- STREAM_PROJECT |PARTITIONED|
+ assign [$$139] <- [cast({"id": $$68,
"no_in_response_to": object-remove($$s, "in-response-to")})]
+ -- ASSIGN |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ replicate
+ -- REPLICATE |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ data-scan []<-[$$68, $$s] <-
TinySocial.FacebookMessages
+ -- DATASOURCE_SCAN |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ empty-tuple-source
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ project ([$$141, $$69])
+ -- STREAM_PROJECT |PARTITIONED|
+ assign [$$141] <- [cast({"id": $$69, "user": $$t})]
+ -- ASSIGN |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ data-scan []<-[$$69, $$t] <- TinySocial.FacebookUsers
+ -- DATASOURCE_SCAN |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ empty-tuple-source
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ project ([$$140, $$70])
+ -- STREAM_PROJECT |PARTITIONED|
+ assign [$$140] <- [cast({"id": $$70, "no_author_id":
object-remove($$s, "author-id")})]
+ -- ASSIGN |PARTITIONED|
+ project ([$$70, $$s])
+ -- STREAM_PROJECT |PARTITIONED|
+ assign [$$70, $$s] <- [$$68, $$s]
+ -- ASSIGN |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ replicate
+ -- REPLICATE |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ data-scan []<-[$$68, $$s] <-
TinySocial.FacebookMessages
+ -- DATASOURCE_SCAN |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ empty-tuple-source
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 5a544b2e45..7b875e2a3c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -15007,6 +15007,11 @@
<output-dir compare="Text">query-ASTERIXDB-1354</output-dir>
</compilation-unit>
</test-case>
+ <test-case FilePath="union">
+ <compilation-unit name="union_type_cast">
+ <output-dir compare="Text">union_type_cast</output-dir>
+ </compilation-unit>
+ </test-case>
</test-group>
<test-group name="upsert">
<test-case FilePath="upsert">
diff --git
a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/ARecordType.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/ARecordType.java
index e256e1b50a..fd51433aac 100644
---
a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/ARecordType.java
+++
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/ARecordType.java
@@ -25,7 +25,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
import java.util.Set;
import org.apache.asterix.common.annotations.IRecordTypeAnnotation;
@@ -73,30 +72,21 @@ public class ARecordType extends AbstractComplexType {
private final Set<String> allPossibleAdditionalFieldNames;
/**
- * @param typeName
- * the name of the type
- * @param fieldNames
- * the names of the closed fields
- * @param fieldTypes
- * the types of the closed fields
- * @param isOpen
- * whether the record is open
+ * @param typeName the name of the type
+ * @param fieldNames the names of the closed fields
+ * @param fieldTypes the types of the closed fields
+ * @param isOpen whether the record is open
*/
public ARecordType(String typeName, String[] fieldNames, IAType[]
fieldTypes, boolean isOpen) {
this(typeName, fieldNames, fieldTypes, isOpen, null);
}
/**
- * @param typeName
- * the name of the type
- * @param fieldNames
- * the names of the closed fields
- * @param fieldTypes
- * the types of the closed fields
- * @param isOpen
- * whether the record is open
- * @param allPossibleAdditionalFieldNames,
- * all possible additional field names.
+ * @param typeName the name of the type
+ * @param fieldNames the names of the closed fields
+ * @param fieldTypes the types of the closed fields
+ * @param isOpen whether the record is open
+ * @param allPossibleAdditionalFieldNames, all possible additional field
names.
*/
public ARecordType(String typeName, String[] fieldNames, IAType[]
fieldTypes, boolean isOpen,
Set<String> allPossibleAdditionalFieldNames) {
@@ -189,8 +179,7 @@ public class ARecordType extends AbstractComplexType {
/**
* Returns the position of the field in the closed schema or -1 if the
field does not exist.
*
- * @param fieldName
- * the name of the field whose position is sought
+ * @param fieldName the name of the field whose position is sought
* @return the position of the field in the closed schema or -1 if the
field does not exist.
*/
public int getFieldIndex(String fieldName) {
@@ -206,10 +195,8 @@ public class ARecordType extends AbstractComplexType {
}
/**
- * @param subFieldName
- * The full pathname of the child
- * @param parent
- * The type of the parent
+ * @param subFieldName The full pathname of the child
+ * @param parent The type of the parent
* @return the type of the child
*/
@@ -222,8 +209,7 @@ public class ARecordType extends AbstractComplexType {
}
/**
- * @param subFieldName
- * The full pathname of the child
+ * @param subFieldName The full pathname of the child
* @return the type of the child
* @throws AsterixException
*/
@@ -248,9 +234,7 @@ public class ARecordType extends AbstractComplexType {
}
/**
- *
- * @param subFieldName
- * The full pathname of the field
+ * @param subFieldName The full pathname of the field
* @return The nullability of the field
* @throws AlgebricksException
*/
@@ -283,10 +267,9 @@ public class ARecordType extends AbstractComplexType {
/**
* Returns the field type of the field name if it exists, otherwise null.
*
- * @param fieldName
- * the fieldName whose type is sought
+ * @param fieldName the fieldName whose type is sought
* @return the field type of the field name if it exists, otherwise null
- * NOTE: this method doesn't work for nested fields
+ * NOTE: this method doesn't work for nested fields
*/
public IAType getFieldType(String fieldName) {
int fieldPos = getFieldIndex(fieldName);
@@ -299,8 +282,7 @@ public class ARecordType extends AbstractComplexType {
/**
* Returns true or false indicating whether or not a field is closed.
*
- * @param fieldName
- * the name of the field to check
+ * @param fieldName the name of the field to check
* @return true if fieldName is a closed field, otherwise false
*/
public boolean isClosedField(String fieldName) {
@@ -360,8 +342,7 @@ public class ARecordType extends AbstractComplexType {
}
ARecordType rt = (ARecordType) obj;
return (isOpen == rt.isOpen) && Arrays.deepEquals(fieldNames,
rt.fieldNames)
- && Arrays.deepEquals(fieldTypes, rt.fieldTypes)
- && Objects.equals(allPossibleAdditionalFieldNames,
rt.allPossibleAdditionalFieldNames);
+ && Arrays.deepEquals(fieldTypes, rt.fieldTypes);
}
@Override
@@ -382,11 +363,7 @@ public class ARecordType extends AbstractComplexType {
ObjectNode type = om.createObjectNode();
type.put("type", ARecordType.class.getName());
type.put("name", typeName);
- if (isOpen) {
- type.put("open", true);
- } else {
- type.put("open", false);
- }
+ type.put("open", isOpen);
ArrayNode fields = om.createArrayNode();
for (int i = 0; i < fieldNames.length; i++) {