You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Preston Carman (Code Review)" <do...@asterixdb.incubator.apache.org> on 2016/01/26 00:37:35 UTC
Change in asterixdb[master]: ASTERIXDB-1277 - Added interval desc sort on end point.
Preston Carman has uploaded a new change for review.
https://asterix-gerrit.ics.uci.edu/598
Change subject: ASTERIXDB-1277 - Added interval desc sort on end point.
......................................................................
ASTERIXDB-1277 - Added interval desc sort on end point.
The default interval sort order is now the following:
asc - start point asc, end point asc
desc - end point desc, start point desc
Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
---
A asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
M asterix-app/src/test/resources/runtimets/testsuite.xml
R asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
C asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
M asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
M asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
16 files changed, 376 insertions(+), 217 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/98/598/1
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml b/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
new file mode 100644
index 0000000..6c3cc06
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
@@ -0,0 +1,209 @@
+ <test-case FilePath="comparison">
+ <compilation-unit name="year_month_duration_order">
+ <output-dir compare="Text">year_month_duration_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="datetime_order">
+ <output-dir compare="Text">datetime_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="datetime_range">
+ <output-dir compare="Text">datetime_range</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="datetime_tzeq">
+ <output-dir compare="Text">datetime_tzeq</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="interval_order">
+ <output-dir compare="Text">interval_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="time_order">
+ <output-dir compare="Text">time_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="date_order">
+ <output-dir compare="Text">date_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="double">
+ <output-dir compare="Text">double</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="double_gte_01">
+ <output-dir compare="Text">double_gte_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="double_null">
+ <output-dir compare="Text">double_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="eq_01">
+ <output-dir compare="Text">eq_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="float">
+ <output-dir compare="Text">float</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="float_null">
+ <output-dir compare="Text">float_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="gt_01">
+ <output-dir compare="Text">gt_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="gte_01">
+ <output-dir compare="Text">gte_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int16">
+ <output-dir compare="Text">int16</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int16_null">
+ <output-dir compare="Text">int16_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int32">
+ <output-dir compare="Text">int32</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int32_null">
+ <output-dir compare="Text">int32_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int64">
+ <output-dir compare="Text">int64</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int64_null">
+ <output-dir compare="Text">int64_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int8">
+ <output-dir compare="Text">int8</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int8_null">
+ <output-dir compare="Text">int8_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="lt_01">
+ <output-dir compare="Text">lt_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="lte_01">
+ <output-dir compare="Text">lte_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="neq_01">
+ <output-dir compare="Text">neq_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="comparison">
+ <compilation-unit name="numeric-comparison_01">
+ <output-dir compare="Text">numeric-comparison_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="comparison">
+ <compilation-unit name="string">
+ <output-dir compare="Text">string</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="string_null">
+ <output-dir compare="Text">string_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_equality">
+ <output-dir compare="Text">issue363_equality</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_duration">
+ <output-dir compare="Text">issue363_inequality_duration</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the DURATION type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_interval">
+ <output-dir compare="Text">issue363_inequality_interval</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the INTERVAL type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_point">
+ <output-dir compare="Text">issue363_inequality_point</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the POINT type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_line">
+ <output-dir compare="Text">issue363_inequality_line</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the LINE type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_polygon">
+ <output-dir compare="Text">issue363_inequality_polygon</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the POLYGON type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_rectangle">
+ <output-dir compare="Text">issue363_inequality_rectangle</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the RECTANGLE type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_circle">
+ <output-dir compare="Text">issue363_inequality_circle</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the CIRCLE type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="binary">
+ <output-dir compare="Text">binary</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="binary_null">
+ <output-dir compare="Text">binary_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="uuid_1">
+ <output-dir compare="Text">uuid_1</output-dir>
+ </compilation-unit>
+ </test-case>
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
new file mode 100644
index 0000000..950d2b4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
@@ -0,0 +1,22 @@
+/*
+ * 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 test if exists;
+
+create dataverse test;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * 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.
+ */
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
new file mode 100644
index 0000000..8ccca18
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
@@ -0,0 +1,31 @@
+/*
+ * 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 dataverse test;
+
+let $id1 := interval-from-date("2002-01-01", "2003-01-01")
+let $id2 := interval-from-date("2006-01-01", "2010-01-01")
+let $id3 := interval-from-date("2001-01-01", "2010-01-01")
+let $id4 := interval-from-date("2003-01-01", "2008-01-01")
+let $id5 := interval-from-date("2002-01-01", "2010-01-01")
+let $id6 := interval-from-date("2004-01-01", "2009-01-01")
+let $id7 := interval-from-date("2003-01-01", "2008-01-01")
+
+for $id in [$id1, $id2, $id3, $id4, $id5, $id6, $id7]
+order by $id
+return $id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
new file mode 100644
index 0000000..e0d9410
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
@@ -0,0 +1,31 @@
+/*
+ * 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 dataverse test;
+
+let $id1 := interval-from-date("2002-01-01", "2003-01-01")
+let $id2 := interval-from-date("2006-01-01", "2010-01-01")
+let $id3 := interval-from-date("2001-01-01", "2010-01-01")
+let $id4 := interval-from-date("2003-01-01", "2008-01-01")
+let $id5 := interval-from-date("2002-01-01", "2010-01-01")
+let $id6 := interval-from-date("2004-01-01", "2009-01-01")
+let $id7 := interval-from-date("2003-01-01", "2008-01-01")
+
+for $id in [$id1, $id2, $id3, $id4, $id5, $id6, $id7]
+order by $id desc
+return $id;
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm b/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
new file mode 100644
index 0000000..35b6077
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
@@ -0,0 +1,7 @@
+interval-date("2001-01-01, 2010-01-01")
+interval-date("2002-01-01, 2003-01-01")
+interval-date("2002-01-01, 2010-01-01")
+interval-date("2003-01-01, 2008-01-01")
+interval-date("2003-01-01, 2008-01-01")
+interval-date("2004-01-01, 2009-01-01")
+interval-date("2006-01-01, 2010-01-01")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm b/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
new file mode 100644
index 0000000..b8b3d7a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
@@ -0,0 +1,7 @@
+interval-date("2006-01-01, 2010-01-01")
+interval-date("2002-01-01, 2010-01-01")
+interval-date("2001-01-01, 2010-01-01")
+interval-date("2004-01-01, 2009-01-01")
+interval-date("2003-01-01, 2008-01-01")
+interval-date("2003-01-01, 2008-01-01")
+interval-date("2002-01-01, 2003-01-01")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 2e0c073..a20dc15 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -18,6 +18,7 @@
!-->
<!DOCTYPE test-suite [
+<!ENTITY ComparisonQueries SYSTEM "queries/comparison/ComparisonQueries.xml">
<!ENTITY RecordsQueries SYSTEM "queries/records/RecordsQueries.xml">
<!ENTITY DeepEqualQueries SYSTEM "queries/comparison/deep_equal/DeepEqualQueries.xml">
]>
@@ -971,200 +972,7 @@
</test-case>
</test-group>
<test-group name="comparison">
- <test-case FilePath="comparison">
- <compilation-unit name="year_month_duration_order">
- <output-dir compare="Text">year_month_duration_order</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="datetime_order">
- <output-dir compare="Text">datetime_order</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="datetime_range">
- <output-dir compare="Text">datetime_range</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="datetime_tzeq">
- <output-dir compare="Text">datetime_tzeq</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="double">
- <output-dir compare="Text">double</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="double_gte_01">
- <output-dir compare="Text">double_gte_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="double_null">
- <output-dir compare="Text">double_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="eq_01">
- <output-dir compare="Text">eq_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="float">
- <output-dir compare="Text">float</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="float_null">
- <output-dir compare="Text">float_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="gt_01">
- <output-dir compare="Text">gt_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="gte_01">
- <output-dir compare="Text">gte_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int16">
- <output-dir compare="Text">int16</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int16_null">
- <output-dir compare="Text">int16_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int32">
- <output-dir compare="Text">int32</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int32_null">
- <output-dir compare="Text">int32_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int64">
- <output-dir compare="Text">int64</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int64_null">
- <output-dir compare="Text">int64_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int8">
- <output-dir compare="Text">int8</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int8_null">
- <output-dir compare="Text">int8_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="lt_01">
- <output-dir compare="Text">lt_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="lte_01">
- <output-dir compare="Text">lte_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="neq_01">
- <output-dir compare="Text">neq_01</output-dir>
- </compilation-unit>
- </test-case>
- <!--
- <test-case FilePath="comparison">
- <compilation-unit name="numeric-comparison_01">
- <output-dir compare="Text">numeric-comparison_01</output-dir>
- </compilation-unit>
- </test-case>
- -->
- <test-case FilePath="comparison">
- <compilation-unit name="string">
- <output-dir compare="Text">string</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="string_null">
- <output-dir compare="Text">string_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_equality">
- <output-dir compare="Text">issue363_equality</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_duration">
- <output-dir compare="Text">issue363_inequality_duration</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the DURATION type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_interval">
- <output-dir compare="Text">issue363_inequality_interval</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the INTERVAL type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_point">
- <output-dir compare="Text">issue363_inequality_point</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the POINT type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_line">
- <output-dir compare="Text">issue363_inequality_line</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the LINE type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_polygon">
- <output-dir compare="Text">issue363_inequality_polygon</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the POLYGON type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_rectangle">
- <output-dir compare="Text">issue363_inequality_rectangle</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the RECTANGLE type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_circle">
- <output-dir compare="Text">issue363_inequality_circle</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the CIRCLE type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="binary">
- <output-dir compare="Text">binary</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="binary_null">
- <output-dir compare="Text">binary_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="uuid_1">
- <output-dir compare="Text">uuid_1</output-dir>
- </compilation-unit>
- </test-case>
+ &ComparisonQueries;
</test-group>
<test-group name="constructor">
<test-case FilePath="constructor">
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
similarity index 81%
rename from asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
rename to asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
index f7c4428..018a13b 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
@@ -23,13 +23,13 @@
import org.apache.hyracks.api.dataflow.value.IBinaryComparator;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
-public class AIntervalPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+public class AIntervalAscPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
private static final long serialVersionUID = 1L;
- public static final AIntervalPartialBinaryComparatorFactory INSTANCE = new AIntervalPartialBinaryComparatorFactory();
+ public static final AIntervalAscPartialBinaryComparatorFactory INSTANCE = new AIntervalAscPartialBinaryComparatorFactory();
- private AIntervalPartialBinaryComparatorFactory() {
+ private AIntervalAscPartialBinaryComparatorFactory() {
}
@@ -42,19 +42,20 @@
@Override
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
- int c = Double.compare(
+ int c = Long.compare(
AInt64SerializerDeserializer.getLong(b1,
s1 + AIntervalSerializerDeserializer.getIntervalStartOffset()),
AInt64SerializerDeserializer.getLong(b2,
s2 + AIntervalSerializerDeserializer.getIntervalStartOffset()));
if (c == 0) {
- c = Double.compare(
+ c = Long.compare(
AInt64SerializerDeserializer.getLong(b1,
s1 + AIntervalSerializerDeserializer.getIntervalEndOffset()),
AInt64SerializerDeserializer.getLong(b2,
s2 + AIntervalSerializerDeserializer.getIntervalEndOffset()));
if (c == 0) {
- c = Byte.compare(b1[s1 + 16], b2[s2 + 16]);
+ c = Byte.compare(b1[s1 + AIntervalSerializerDeserializer.getIntervalTagOffset()], b2[s2
+ + AIntervalSerializerDeserializer.getIntervalTagOffset()]);
}
}
return c;
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
similarity index 75%
copy from asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
copy to asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
index f7c4428..49acd60 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
@@ -23,13 +23,13 @@
import org.apache.hyracks.api.dataflow.value.IBinaryComparator;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
-public class AIntervalPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+public class AIntervalDescPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
private static final long serialVersionUID = 1L;
- public static final AIntervalPartialBinaryComparatorFactory INSTANCE = new AIntervalPartialBinaryComparatorFactory();
+ public static final AIntervalDescPartialBinaryComparatorFactory INSTANCE = new AIntervalDescPartialBinaryComparatorFactory();
- private AIntervalPartialBinaryComparatorFactory() {
+ private AIntervalDescPartialBinaryComparatorFactory() {
}
@@ -42,22 +42,23 @@
@Override
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
- int c = Double.compare(
+ int c = Long.compare(
AInt64SerializerDeserializer.getLong(b1,
- s1 + AIntervalSerializerDeserializer.getIntervalStartOffset()),
+ s1 + AIntervalSerializerDeserializer.getIntervalEndOffset()),
AInt64SerializerDeserializer.getLong(b2,
- s2 + AIntervalSerializerDeserializer.getIntervalStartOffset()));
+ s2 + AIntervalSerializerDeserializer.getIntervalEndOffset()));
if (c == 0) {
- c = Double.compare(
+ c = Long.compare(
AInt64SerializerDeserializer.getLong(b1,
- s1 + AIntervalSerializerDeserializer.getIntervalEndOffset()),
+ s1 + AIntervalSerializerDeserializer.getIntervalStartOffset()),
AInt64SerializerDeserializer.getLong(b2,
- s2 + AIntervalSerializerDeserializer.getIntervalEndOffset()));
+ s2 + AIntervalSerializerDeserializer.getIntervalStartOffset()));
if (c == 0) {
- c = Byte.compare(b1[s1 + 16], b2[s2 + 16]);
+ c = Byte.compare(b1[s1 + AIntervalSerializerDeserializer.getIntervalTagOffset()], b2[s2
+ + AIntervalSerializerDeserializer.getIntervalTagOffset()]);
}
}
- return c;
+ return -c;
}
};
}
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
index ad3be0e..6a24cf3 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
@@ -89,7 +89,7 @@
final IBinaryComparator ascDurationComp = ADurationPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
// INTERVAL
- final IBinaryComparator ascIntervalComp = AIntervalPartialBinaryComparatorFactory.INSTANCE
+ final IBinaryComparator ascIntervalComp = AIntervalAscPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
// LINE
final IBinaryComparator ascLineComp = ALinePartialBinaryComparatorFactory.INSTANCE.createBinaryComparator();
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
index 6030908..85cb327 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
@@ -18,6 +18,8 @@
*/
package org.apache.asterix.dataflow.data.nontagged.comparators;
+import org.apache.asterix.om.types.ATypeTag;
+import org.apache.asterix.om.types.EnumDeserializer;
import org.apache.hyracks.api.dataflow.value.IBinaryComparator;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -36,8 +38,17 @@
return new ABinaryComparator() {
final IBinaryComparator ascComp = AObjectAscBinaryComparatorFactory.INSTANCE.createBinaryComparator();
+ // INTERVAL
+ final IBinaryComparator descIntervalComp = AIntervalDescPartialBinaryComparatorFactory.INSTANCE
+ .createBinaryComparator();
+
@Override
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) throws HyracksDataException {
+ ATypeTag tag1 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b1[s1]);
+ ATypeTag tag2 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b2[s2]);
+ if (tag1 == ATypeTag.INTERVAL && tag2 == ATypeTag.INTERVAL) {
+ return descIntervalComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
+ }
return -ascComp.compare(b1, s1, l1, b2, s2, l2);
}
};
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
index 767a343..77b8b3a 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
@@ -67,7 +67,7 @@
.createBinaryComparator();
final IBinaryComparator ascDurationComp = ADurationPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
- final IBinaryComparator ascIntervalComp = AIntervalPartialBinaryComparatorFactory.INSTANCE
+ final IBinaryComparator ascIntervalComp = AIntervalAscPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
final IBinaryComparator ascLineComp = ALinePartialBinaryComparatorFactory.INSTANCE.createBinaryComparator();
final IBinaryComparator ascPointComp = APointPartialBinaryComparatorFactory.INSTANCE
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
index 5d08d52..2adeded 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
@@ -72,6 +72,10 @@
return 8;
}
+ public static int getIntervalTagOffset() {
+ return 16;
+ }
+
public static byte getIntervalTimeType(byte[] data, int offset) {
return data[offset + 8 * 2];
}
diff --git a/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java b/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
index 8f43a17..c5d1b1d 100644
--- a/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
+++ b/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
@@ -23,7 +23,8 @@
import org.apache.asterix.dataflow.data.nontagged.comparators.ABinaryComparator;
import org.apache.asterix.dataflow.data.nontagged.comparators.ACirclePartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.ADurationPartialBinaryComparatorFactory;
-import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalPartialBinaryComparatorFactory;
+import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalAscPartialBinaryComparatorFactory;
+import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalDescPartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.ALinePartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.AObjectAscBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.AObjectDescBinaryComparatorFactory;
@@ -172,7 +173,7 @@
return addOffset(ADurationPartialBinaryComparatorFactory.INSTANCE, ascending);
}
case INTERVAL: {
- return addOffset(AIntervalPartialBinaryComparatorFactory.INSTANCE, ascending);
+ return addOffset(intervalBinaryComparatorFactory(ascending), ascending);
}
case UUID: {
return addOffset(AUUIDPartialBinaryComparatorFactory.INSTANCE, ascending);
@@ -224,4 +225,12 @@
}
}
+ private IBinaryComparatorFactory intervalBinaryComparatorFactory(boolean ascending) {
+ if (ascending) {
+ return AIntervalAscPartialBinaryComparatorFactory.INSTANCE;
+ } else {
+ return AIntervalDescPartialBinaryComparatorFactory.INSTANCE;
+ }
+ }
+
}
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
index 356a77b..b2a91ea 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
@@ -23,7 +23,7 @@
import org.apache.asterix.dataflow.data.nontagged.comparators.ABinaryComparator;
import org.apache.asterix.dataflow.data.nontagged.comparators.ACirclePartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.ADurationPartialBinaryComparatorFactory;
-import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalPartialBinaryComparatorFactory;
+import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalAscPartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.ALinePartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.APoint3DPartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.APointPartialBinaryComparatorFactory;
@@ -85,7 +85,7 @@
.createBinaryComparator();
protected IBinaryComparator durationBinaryComp = ADurationPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
- protected IBinaryComparator intervalBinaryComp = AIntervalPartialBinaryComparatorFactory.INSTANCE
+ protected IBinaryComparator intervalBinaryComp = AIntervalAscPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
protected IBinaryComparator lineBinaryComparator = ALinePartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 6: Verified+1
Build Successful
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/755/ : SUCCESS
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 6
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 3: Verified+1
Build Successful
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/752/ : SUCCESS
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Murtadha Hubail (Code Review)" <do...@asterixdb.incubator.apache.org>.
Murtadha Hubail has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 3:
(1 comment)
Sorry for the hijacking :-)
https://asterix-gerrit.ics.uci.edu/#/c/598/3/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java:
Line 33: private static final int INTERVAL_START_POINT_OFFSET = 0;
> Each increases by 8 since sizeof(long) is 8 in C++ terminology? Maybe we ca
If they are supposed to be consecutive, they should be written based on each other, and instead of the 8, it's better to use Long.BYTES (e.g. INTERVAl_END_POINT_OFFSET = INTERVAL_START_POINT_OFFSET + Long.Bytes)
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: Yes
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to use end point.
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to use end point.
......................................................................
Patch Set 1: Verified-1
Build Failed
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/746/ : ABORTED
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Preston Carman (Code Review)" <do...@asterixdb.incubator.apache.org>.
Preston Carman has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 1:
(4 comments)
The latest patch now includes comments. :-)
https://asterix-gerrit.ics.uci.edu/#/c/598/1/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java:
Line 43: @Override
> Can we add some comments here to illustrate the comparison logic?
Done
https://asterix-gerrit.ics.uci.edu/#/c/598/1/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java:
Line 44: public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
> Can we add some comments here to illustrate the comparison logic?
Done
https://asterix-gerrit.ics.uci.edu/#/c/598/1/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java:
Line 41: // INTERVAL
> Can we put some comments here why interval comparison needs to be treated s
Done
https://asterix-gerrit.ics.uci.edu/#/c/598/1/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java:
Line 76: return 16;
> Can we declare some constant like INTERVAL_TAG_OFFSET and use it here? for
Done
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: Yes
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to use end point.
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to use end point.
......................................................................
Patch Set 2:
Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/747/
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 6:
Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/755/
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 6
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Preston Carman (Code Review)" <do...@asterixdb.incubator.apache.org>.
Hello Taewoo Kim, Jenkins,
I'd like you to reexamine a change. Please visit
https://asterix-gerrit.ics.uci.edu/598
to look at the new patch set (#6).
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
The default interval sort order is now the following:
asc - start point asc, end point asc
desc - end point desc, start point desc
Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
---
A asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
M asterix-app/src/test/resources/runtimets/testsuite.xml
R asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
C asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
M asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
M asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
16 files changed, 393 insertions(+), 219 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/98/598/6
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 6
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Taewoo Kim (Code Review)" <do...@asterixdb.incubator.apache.org>.
Taewoo Kim has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 3: Code-Review+2
(2 comments)
LGTM - just two minor comments.
https://asterix-gerrit.ics.uci.edu/#/c/598/3/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java:
Line 33: private static final int INTERVAL_START_POINT_OFFSET = 0;
Each increases by 8 since sizeof(long) is 8 in C++ terminology? Maybe we can add that fact here for the future references.
https://asterix-gerrit.ics.uci.edu/#/c/598/3/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
File asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java:
Line 228: private IBinaryComparatorFactory intervalBinaryComparatorFactory(boolean ascending) {
Again, it may be better to put some comments here why we treat intervalComparators differently.
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: Yes
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Taewoo Kim (Code Review)" <do...@asterixdb.incubator.apache.org>.
Taewoo Kim has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 3:
(1 comment)
https://asterix-gerrit.ics.uci.edu/#/c/598/3/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java:
Line 33: private static final int INTERVAL_START_POINT_OFFSET = 0;
> If they are supposed to be consecutive, they should be written based on eac
Agreed.
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: Yes
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to use end point.
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to use end point.
......................................................................
Patch Set 2: Verified+1
Build Successful
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/747/ : SUCCESS
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Taewoo Kim (Code Review)" <do...@asterixdb.incubator.apache.org>.
Taewoo Kim has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 6: Code-Review+2
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 6
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No
Change in asterixdb[master]: :ASTERIXDB-1277 - Updated interval desc sort to be based on ...
Posted by "Till Westmann (Code Review)" <do...@asterixdb.incubator.apache.org>.
Till Westmann has posted comments on this change.
Change subject: :ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 5:
(1 comment)
https://asterix-gerrit.ics.uci.edu/#/c/598/5//COMMIT_MSG
Commit Message:
Line 7: :ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
The first char here seems wrong
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 5
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: Yes
Change in asterixdb[master]: :ASTERIXDB-1277 - Updated interval desc sort to be based on ...
Posted by "Preston Carman (Code Review)" <do...@asterixdb.incubator.apache.org>.
Preston Carman has posted comments on this change.
Change subject: :ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 3:
(2 comments)
I noticed your second comment after pushing the first change. Both are now ready.
https://asterix-gerrit.ics.uci.edu/#/c/598/3/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java:
Line 33: private static final int INTERVAL_START_POINT_OFFSET = 0;
> Agreed.
That is a much better way. Done.
https://asterix-gerrit.ics.uci.edu/#/c/598/3/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
File asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java:
Line 228: private IBinaryComparatorFactory intervalBinaryComparatorFactory(boolean ascending) {
> Again, it may be better to put some comments here why we treat intervalComp
Done
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: Yes
Change in asterixdb[master]: :ASTERIXDB-1277 - Updated interval desc sort to be based on ...
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: :ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 4: Verified-1
Build Failed
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/753/ : ABORTED
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Added interval desc sort on end point.
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: ASTERIXDB-1277 - Added interval desc sort on end point.
......................................................................
Patch Set 1:
Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/746/
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Preston Carman (Code Review)" <do...@asterixdb.incubator.apache.org>.
Preston Carman has submitted this change and it was merged.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
The default interval sort order is now the following:
asc - start point asc, end point asc
desc - end point desc, start point desc
Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Reviewed-on: https://asterix-gerrit.ics.uci.edu/598
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Taewoo Kim <wa...@gmail.com>
---
A asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
M asterix-app/src/test/resources/runtimets/testsuite.xml
R asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
C asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
M asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
M asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
16 files changed, 393 insertions(+), 219 deletions(-)
Approvals:
Taewoo Kim: Looks good to me, approved
Jenkins: Verified
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml b/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
new file mode 100644
index 0000000..6c3cc06
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
@@ -0,0 +1,209 @@
+ <test-case FilePath="comparison">
+ <compilation-unit name="year_month_duration_order">
+ <output-dir compare="Text">year_month_duration_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="datetime_order">
+ <output-dir compare="Text">datetime_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="datetime_range">
+ <output-dir compare="Text">datetime_range</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="datetime_tzeq">
+ <output-dir compare="Text">datetime_tzeq</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="interval_order">
+ <output-dir compare="Text">interval_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="time_order">
+ <output-dir compare="Text">time_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="date_order">
+ <output-dir compare="Text">date_order</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="double">
+ <output-dir compare="Text">double</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="double_gte_01">
+ <output-dir compare="Text">double_gte_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="double_null">
+ <output-dir compare="Text">double_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="eq_01">
+ <output-dir compare="Text">eq_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="float">
+ <output-dir compare="Text">float</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="float_null">
+ <output-dir compare="Text">float_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="gt_01">
+ <output-dir compare="Text">gt_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="gte_01">
+ <output-dir compare="Text">gte_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int16">
+ <output-dir compare="Text">int16</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int16_null">
+ <output-dir compare="Text">int16_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int32">
+ <output-dir compare="Text">int32</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int32_null">
+ <output-dir compare="Text">int32_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int64">
+ <output-dir compare="Text">int64</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int64_null">
+ <output-dir compare="Text">int64_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int8">
+ <output-dir compare="Text">int8</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="int8_null">
+ <output-dir compare="Text">int8_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="lt_01">
+ <output-dir compare="Text">lt_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="lte_01">
+ <output-dir compare="Text">lte_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="neq_01">
+ <output-dir compare="Text">neq_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <!--
+ <test-case FilePath="comparison">
+ <compilation-unit name="numeric-comparison_01">
+ <output-dir compare="Text">numeric-comparison_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ -->
+ <test-case FilePath="comparison">
+ <compilation-unit name="string">
+ <output-dir compare="Text">string</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="string_null">
+ <output-dir compare="Text">string_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_equality">
+ <output-dir compare="Text">issue363_equality</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_duration">
+ <output-dir compare="Text">issue363_inequality_duration</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the DURATION type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_interval">
+ <output-dir compare="Text">issue363_inequality_interval</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the INTERVAL type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_point">
+ <output-dir compare="Text">issue363_inequality_point</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the POINT type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_line">
+ <output-dir compare="Text">issue363_inequality_line</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the LINE type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_polygon">
+ <output-dir compare="Text">issue363_inequality_polygon</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the POLYGON type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_rectangle">
+ <output-dir compare="Text">issue363_inequality_rectangle</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the RECTANGLE type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="issue363_inequality_circle">
+ <output-dir compare="Text">issue363_inequality_circle</output-dir>
+ <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the CIRCLE type are not defined</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="binary">
+ <output-dir compare="Text">binary</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="binary_null">
+ <output-dir compare="Text">binary_null</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="comparison">
+ <compilation-unit name="uuid_1">
+ <output-dir compare="Text">uuid_1</output-dir>
+ </compilation-unit>
+ </test-case>
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
new file mode 100644
index 0000000..950d2b4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
@@ -0,0 +1,22 @@
+/*
+ * 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 test if exists;
+
+create dataverse test;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * 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.
+ */
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
new file mode 100644
index 0000000..8ccca18
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
@@ -0,0 +1,31 @@
+/*
+ * 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 dataverse test;
+
+let $id1 := interval-from-date("2002-01-01", "2003-01-01")
+let $id2 := interval-from-date("2006-01-01", "2010-01-01")
+let $id3 := interval-from-date("2001-01-01", "2010-01-01")
+let $id4 := interval-from-date("2003-01-01", "2008-01-01")
+let $id5 := interval-from-date("2002-01-01", "2010-01-01")
+let $id6 := interval-from-date("2004-01-01", "2009-01-01")
+let $id7 := interval-from-date("2003-01-01", "2008-01-01")
+
+for $id in [$id1, $id2, $id3, $id4, $id5, $id6, $id7]
+order by $id
+return $id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
new file mode 100644
index 0000000..e0d9410
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
@@ -0,0 +1,31 @@
+/*
+ * 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 dataverse test;
+
+let $id1 := interval-from-date("2002-01-01", "2003-01-01")
+let $id2 := interval-from-date("2006-01-01", "2010-01-01")
+let $id3 := interval-from-date("2001-01-01", "2010-01-01")
+let $id4 := interval-from-date("2003-01-01", "2008-01-01")
+let $id5 := interval-from-date("2002-01-01", "2010-01-01")
+let $id6 := interval-from-date("2004-01-01", "2009-01-01")
+let $id7 := interval-from-date("2003-01-01", "2008-01-01")
+
+for $id in [$id1, $id2, $id3, $id4, $id5, $id6, $id7]
+order by $id desc
+return $id;
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm b/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
new file mode 100644
index 0000000..35b6077
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
@@ -0,0 +1,7 @@
+interval-date("2001-01-01, 2010-01-01")
+interval-date("2002-01-01, 2003-01-01")
+interval-date("2002-01-01, 2010-01-01")
+interval-date("2003-01-01, 2008-01-01")
+interval-date("2003-01-01, 2008-01-01")
+interval-date("2004-01-01, 2009-01-01")
+interval-date("2006-01-01, 2010-01-01")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm b/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
new file mode 100644
index 0000000..b8b3d7a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
@@ -0,0 +1,7 @@
+interval-date("2006-01-01, 2010-01-01")
+interval-date("2002-01-01, 2010-01-01")
+interval-date("2001-01-01, 2010-01-01")
+interval-date("2004-01-01, 2009-01-01")
+interval-date("2003-01-01, 2008-01-01")
+interval-date("2003-01-01, 2008-01-01")
+interval-date("2002-01-01, 2003-01-01")
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 2e0c073..a20dc15 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -18,6 +18,7 @@
!-->
<!DOCTYPE test-suite [
+<!ENTITY ComparisonQueries SYSTEM "queries/comparison/ComparisonQueries.xml">
<!ENTITY RecordsQueries SYSTEM "queries/records/RecordsQueries.xml">
<!ENTITY DeepEqualQueries SYSTEM "queries/comparison/deep_equal/DeepEqualQueries.xml">
]>
@@ -971,200 +972,7 @@
</test-case>
</test-group>
<test-group name="comparison">
- <test-case FilePath="comparison">
- <compilation-unit name="year_month_duration_order">
- <output-dir compare="Text">year_month_duration_order</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="datetime_order">
- <output-dir compare="Text">datetime_order</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="datetime_range">
- <output-dir compare="Text">datetime_range</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="datetime_tzeq">
- <output-dir compare="Text">datetime_tzeq</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="double">
- <output-dir compare="Text">double</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="double_gte_01">
- <output-dir compare="Text">double_gte_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="double_null">
- <output-dir compare="Text">double_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="eq_01">
- <output-dir compare="Text">eq_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="float">
- <output-dir compare="Text">float</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="float_null">
- <output-dir compare="Text">float_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="gt_01">
- <output-dir compare="Text">gt_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="gte_01">
- <output-dir compare="Text">gte_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int16">
- <output-dir compare="Text">int16</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int16_null">
- <output-dir compare="Text">int16_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int32">
- <output-dir compare="Text">int32</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int32_null">
- <output-dir compare="Text">int32_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int64">
- <output-dir compare="Text">int64</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int64_null">
- <output-dir compare="Text">int64_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int8">
- <output-dir compare="Text">int8</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="int8_null">
- <output-dir compare="Text">int8_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="lt_01">
- <output-dir compare="Text">lt_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="lte_01">
- <output-dir compare="Text">lte_01</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="neq_01">
- <output-dir compare="Text">neq_01</output-dir>
- </compilation-unit>
- </test-case>
- <!--
- <test-case FilePath="comparison">
- <compilation-unit name="numeric-comparison_01">
- <output-dir compare="Text">numeric-comparison_01</output-dir>
- </compilation-unit>
- </test-case>
- -->
- <test-case FilePath="comparison">
- <compilation-unit name="string">
- <output-dir compare="Text">string</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="string_null">
- <output-dir compare="Text">string_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_equality">
- <output-dir compare="Text">issue363_equality</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_duration">
- <output-dir compare="Text">issue363_inequality_duration</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the DURATION type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_interval">
- <output-dir compare="Text">issue363_inequality_interval</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the INTERVAL type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_point">
- <output-dir compare="Text">issue363_inequality_point</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the POINT type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_line">
- <output-dir compare="Text">issue363_inequality_line</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the LINE type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_polygon">
- <output-dir compare="Text">issue363_inequality_polygon</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the POLYGON type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_rectangle">
- <output-dir compare="Text">issue363_inequality_rectangle</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the RECTANGLE type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="issue363_inequality_circle">
- <output-dir compare="Text">issue363_inequality_circle</output-dir>
- <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Comparison operations (GT, GE, LT, and LE) for the CIRCLE type are not defined</expected-error>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="binary">
- <output-dir compare="Text">binary</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="binary_null">
- <output-dir compare="Text">binary_null</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="comparison">
- <compilation-unit name="uuid_1">
- <output-dir compare="Text">uuid_1</output-dir>
- </compilation-unit>
- </test-case>
+ &ComparisonQueries;
</test-group>
<test-group name="constructor">
<test-case FilePath="constructor">
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
similarity index 74%
rename from asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
rename to asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
index f7c4428..6efc7ff 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
@@ -23,13 +23,13 @@
import org.apache.hyracks.api.dataflow.value.IBinaryComparator;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
-public class AIntervalPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+public class AIntervalAscPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
private static final long serialVersionUID = 1L;
- public static final AIntervalPartialBinaryComparatorFactory INSTANCE = new AIntervalPartialBinaryComparatorFactory();
+ public static final AIntervalAscPartialBinaryComparatorFactory INSTANCE = new AIntervalAscPartialBinaryComparatorFactory();
- private AIntervalPartialBinaryComparatorFactory() {
+ private AIntervalAscPartialBinaryComparatorFactory() {
}
@@ -42,19 +42,23 @@
@Override
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
- int c = Double.compare(
+ // The ascending interval comparator sorts intervals first by start point, then by end point.
+ // If the interval have the same point values, the final comparison orders the intervals by type
+ // (datetime, date, time).
+ int c = Long.compare(
AInt64SerializerDeserializer.getLong(b1,
s1 + AIntervalSerializerDeserializer.getIntervalStartOffset()),
AInt64SerializerDeserializer.getLong(b2,
s2 + AIntervalSerializerDeserializer.getIntervalStartOffset()));
if (c == 0) {
- c = Double.compare(
+ c = Long.compare(
AInt64SerializerDeserializer.getLong(b1,
s1 + AIntervalSerializerDeserializer.getIntervalEndOffset()),
AInt64SerializerDeserializer.getLong(b2,
s2 + AIntervalSerializerDeserializer.getIntervalEndOffset()));
if (c == 0) {
- c = Byte.compare(b1[s1 + 16], b2[s2 + 16]);
+ c = Byte.compare(b1[s1 + AIntervalSerializerDeserializer.getIntervalTagOffset()], b2[s2
+ + AIntervalSerializerDeserializer.getIntervalTagOffset()]);
}
}
return c;
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
similarity index 67%
copy from asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
copy to asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
index f7c4428..9a09623 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
@@ -23,13 +23,13 @@
import org.apache.hyracks.api.dataflow.value.IBinaryComparator;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
-public class AIntervalPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+public class AIntervalDescPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
private static final long serialVersionUID = 1L;
- public static final AIntervalPartialBinaryComparatorFactory INSTANCE = new AIntervalPartialBinaryComparatorFactory();
+ public static final AIntervalDescPartialBinaryComparatorFactory INSTANCE = new AIntervalDescPartialBinaryComparatorFactory();
- private AIntervalPartialBinaryComparatorFactory() {
+ private AIntervalDescPartialBinaryComparatorFactory() {
}
@@ -42,22 +42,27 @@
@Override
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
- int c = Double.compare(
+ // The descending interval comparator sorts intervals first by end point, then by start point.
+ // If the interval have the same point values, the final comparison orders the intervals by type
+ // (time, date, datetime).
+ int c = Long.compare(
AInt64SerializerDeserializer.getLong(b1,
- s1 + AIntervalSerializerDeserializer.getIntervalStartOffset()),
+ s1 + AIntervalSerializerDeserializer.getIntervalEndOffset()),
AInt64SerializerDeserializer.getLong(b2,
- s2 + AIntervalSerializerDeserializer.getIntervalStartOffset()));
+ s2 + AIntervalSerializerDeserializer.getIntervalEndOffset()));
if (c == 0) {
- c = Double.compare(
+ c = Long.compare(
AInt64SerializerDeserializer.getLong(b1,
- s1 + AIntervalSerializerDeserializer.getIntervalEndOffset()),
+ s1 + AIntervalSerializerDeserializer.getIntervalStartOffset()),
AInt64SerializerDeserializer.getLong(b2,
- s2 + AIntervalSerializerDeserializer.getIntervalEndOffset()));
+ s2 + AIntervalSerializerDeserializer.getIntervalStartOffset()));
if (c == 0) {
- c = Byte.compare(b1[s1 + 16], b2[s2 + 16]);
+ c = Byte.compare(b1[s1 + AIntervalSerializerDeserializer.getIntervalTagOffset()],
+ b2[s2 + AIntervalSerializerDeserializer.getIntervalTagOffset()]);
}
}
- return c;
+ // Since the comparisons are based on ascending order, the result is reversed.
+ return -c;
}
};
}
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
index ad3be0e..6a24cf3 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
@@ -89,7 +89,7 @@
final IBinaryComparator ascDurationComp = ADurationPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
// INTERVAL
- final IBinaryComparator ascIntervalComp = AIntervalPartialBinaryComparatorFactory.INSTANCE
+ final IBinaryComparator ascIntervalComp = AIntervalAscPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
// LINE
final IBinaryComparator ascLineComp = ALinePartialBinaryComparatorFactory.INSTANCE.createBinaryComparator();
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
index 6030908..5db1bcd 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
@@ -18,6 +18,8 @@
*/
package org.apache.asterix.dataflow.data.nontagged.comparators;
+import org.apache.asterix.om.types.ATypeTag;
+import org.apache.asterix.om.types.EnumDeserializer;
import org.apache.hyracks.api.dataflow.value.IBinaryComparator;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -36,8 +38,19 @@
return new ABinaryComparator() {
final IBinaryComparator ascComp = AObjectAscBinaryComparatorFactory.INSTANCE.createBinaryComparator();
+ // INTERVAL
+ // Interval asc and desc comparator factories are not the inverse of each other.
+ // Thus, we need to specify the interval desc comparator factory for descending comparisons.
+ final IBinaryComparator descIntervalComp = AIntervalDescPartialBinaryComparatorFactory.INSTANCE
+ .createBinaryComparator();
+
@Override
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) throws HyracksDataException {
+ ATypeTag tag1 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b1[s1]);
+ ATypeTag tag2 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b2[s2]);
+ if (tag1 == ATypeTag.INTERVAL && tag2 == ATypeTag.INTERVAL) {
+ return descIntervalComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
+ }
return -ascComp.compare(b1, s1, l1, b2, s2, l2);
}
};
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
index 767a343..77b8b3a 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
@@ -67,7 +67,7 @@
.createBinaryComparator();
final IBinaryComparator ascDurationComp = ADurationPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
- final IBinaryComparator ascIntervalComp = AIntervalPartialBinaryComparatorFactory.INSTANCE
+ final IBinaryComparator ascIntervalComp = AIntervalAscPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
final IBinaryComparator ascLineComp = ALinePartialBinaryComparatorFactory.INSTANCE.createBinaryComparator();
final IBinaryComparator ascPointComp = APointPartialBinaryComparatorFactory.INSTANCE
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
index 5d08d52..94a8917 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
@@ -30,6 +30,10 @@
private static final long serialVersionUID = 1L;
+ private static final int INTERVAL_START_POINT_OFFSET = 0;
+ private static final int INTERVAL_END_POINT_OFFSET = INTERVAL_START_POINT_OFFSET + Long.BYTES;
+ private static final int INTERVAL_TAG_OFFSET = INTERVAL_END_POINT_OFFSET + Long.BYTES;
+
public static final AIntervalSerializerDeserializer INSTANCE = new AIntervalSerializerDeserializer();
private AIntervalSerializerDeserializer() {
@@ -65,11 +69,15 @@
}
public static int getIntervalStartOffset() {
- return 0;
+ return INTERVAL_START_POINT_OFFSET;
}
public static int getIntervalEndOffset() {
- return 8;
+ return INTERVAL_END_POINT_OFFSET;
+ }
+
+ public static int getIntervalTagOffset() {
+ return INTERVAL_TAG_OFFSET;
}
public static byte getIntervalTimeType(byte[] data, int offset) {
diff --git a/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java b/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
index 8f43a17..44851e3 100644
--- a/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
+++ b/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
@@ -23,7 +23,8 @@
import org.apache.asterix.dataflow.data.nontagged.comparators.ABinaryComparator;
import org.apache.asterix.dataflow.data.nontagged.comparators.ACirclePartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.ADurationPartialBinaryComparatorFactory;
-import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalPartialBinaryComparatorFactory;
+import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalAscPartialBinaryComparatorFactory;
+import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalDescPartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.ALinePartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.AObjectAscBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.AObjectDescBinaryComparatorFactory;
@@ -172,7 +173,7 @@
return addOffset(ADurationPartialBinaryComparatorFactory.INSTANCE, ascending);
}
case INTERVAL: {
- return addOffset(AIntervalPartialBinaryComparatorFactory.INSTANCE, ascending);
+ return addOffset(intervalBinaryComparatorFactory(ascending), ascending);
}
case UUID: {
return addOffset(AUUIDPartialBinaryComparatorFactory.INSTANCE, ascending);
@@ -224,4 +225,14 @@
}
}
+ private IBinaryComparatorFactory intervalBinaryComparatorFactory(boolean ascending) {
+ // Intervals have separate binary comparator factories, since asc is primarily based on start point
+ // and desc is similarly based on end point.
+ if (ascending) {
+ return AIntervalAscPartialBinaryComparatorFactory.INSTANCE;
+ } else {
+ return AIntervalDescPartialBinaryComparatorFactory.INSTANCE;
+ }
+ }
+
}
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
index 356a77b..b2a91ea 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
@@ -23,7 +23,7 @@
import org.apache.asterix.dataflow.data.nontagged.comparators.ABinaryComparator;
import org.apache.asterix.dataflow.data.nontagged.comparators.ACirclePartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.ADurationPartialBinaryComparatorFactory;
-import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalPartialBinaryComparatorFactory;
+import org.apache.asterix.dataflow.data.nontagged.comparators.AIntervalAscPartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.ALinePartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.APoint3DPartialBinaryComparatorFactory;
import org.apache.asterix.dataflow.data.nontagged.comparators.APointPartialBinaryComparatorFactory;
@@ -85,7 +85,7 @@
.createBinaryComparator();
protected IBinaryComparator durationBinaryComp = ADurationPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
- protected IBinaryComparator intervalBinaryComp = AIntervalPartialBinaryComparatorFactory.INSTANCE
+ protected IBinaryComparator intervalBinaryComp = AIntervalAscPartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
protected IBinaryComparator lineBinaryComparator = ALinePartialBinaryComparatorFactory.INSTANCE
.createBinaryComparator();
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 7
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to use end point.
Posted by "Preston Carman (Code Review)" <do...@asterixdb.incubator.apache.org>.
Preston Carman has uploaded a new patch set (#2).
Change subject: ASTERIXDB-1277 - Updated interval desc sort to use end point.
......................................................................
ASTERIXDB-1277 - Updated interval desc sort to use end point.
The default interval sort order is now the following:
asc - start point asc, end point asc
desc - end point desc, start point desc
Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
---
A asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
M asterix-app/src/test/resources/runtimets/testsuite.xml
R asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
C asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
M asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
M asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
16 files changed, 376 insertions(+), 217 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/98/598/2
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Change in asterixdb[master]: :ASTERIXDB-1277 - Updated interval desc sort to be based on ...
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: :ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 5:
Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/754/
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 5
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Preston Carman (Code Review)" <do...@asterixdb.incubator.apache.org>.
Hello Jenkins,
I'd like you to reexamine a change. Please visit
https://asterix-gerrit.ics.uci.edu/598
to look at the new patch set (#3).
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
The default interval sort order is now the following:
asc - start point asc, end point asc
desc - end point desc, start point desc
Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
---
A asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
M asterix-app/src/test/resources/runtimets/testsuite.xml
R asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
C asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
M asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
M asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
16 files changed, 391 insertions(+), 219 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/98/598/3
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Change in asterixdb[master]: :ASTERIXDB-1277 - Updated interval desc sort to be based on ...
Posted by "Preston Carman (Code Review)" <do...@asterixdb.incubator.apache.org>.
Hello Taewoo Kim, Jenkins,
I'd like you to reexamine a change. Please visit
https://asterix-gerrit.ics.uci.edu/598
to look at the new patch set (#5).
Change subject: :ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
:ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
The default interval sort order is now the following:
asc - start point asc, end point asc
desc - end point desc, start point desc
Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
---
A asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
M asterix-app/src/test/resources/runtimets/testsuite.xml
R asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
C asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
M asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
M asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
16 files changed, 393 insertions(+), 219 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/98/598/5
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 5
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Change in asterixdb[master]: :ASTERIXDB-1277 - Updated interval desc sort to be based on ...
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: :ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 5: Verified+1
Build Successful
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/754/ : SUCCESS
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 5
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 4:
Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/753/
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
Patch Set 3:
Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/752/
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: No
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to use end point.
Posted by "Taewoo Kim (Code Review)" <do...@asterixdb.incubator.apache.org>.
Taewoo Kim has posted comments on this change.
Change subject: ASTERIXDB-1277 - Updated interval desc sort to use end point.
......................................................................
Patch Set 1:
(4 comments)
Good! I just added few comments.
https://asterix-gerrit.ics.uci.edu/#/c/598/1/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java:
Line 43: @Override
Can we add some comments here to illustrate the comparison logic?
https://asterix-gerrit.ics.uci.edu/#/c/598/1/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java:
Line 44: public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
Can we add some comments here to illustrate the comparison logic?
https://asterix-gerrit.ics.uci.edu/#/c/598/1/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java:
Line 41: // INTERVAL
Can we put some comments here why interval comparison needs to be treated specially?
https://asterix-gerrit.ics.uci.edu/#/c/598/1/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
File asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java:
Line 76: return 16;
Can we declare some constant like INTERVAL_TAG_OFFSET and use it here? for the two methods above, it's the same.
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>
Gerrit-HasComments: Yes
Change in asterixdb[master]: ASTERIXDB-1277 - Updated interval desc sort to be based on e...
Posted by "Preston Carman (Code Review)" <do...@asterixdb.incubator.apache.org>.
Hello Taewoo Kim, Jenkins,
I'd like you to reexamine a change. Please visit
https://asterix-gerrit.ics.uci.edu/598
to look at the new patch set (#4).
Change subject: ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
......................................................................
ASTERIXDB-1277 - Updated interval desc sort to be based on end point.
The default interval sort order is now the following:
asc - start point asc, end point asc
desc - end point desc, start point desc
Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
---
A asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.1.ddl.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.2.update.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.3.query.aql
A asterix-app/src/test/resources/runtimets/queries/comparison/interval_order/interval_order.4.query.aql
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.3.adm
A asterix-app/src/test/resources/runtimets/results/comparison/interval_order/interval_order.4.adm
M asterix-app/src/test/resources/runtimets/testsuite.xml
R asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalAscPartialBinaryComparatorFactory.java
C asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AIntervalDescPartialBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/AObjectDescBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/comparators/ListItemBinaryComparatorFactory.java
M asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AIntervalSerializerDeserializer.java
M asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
M asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
16 files changed, 391 insertions(+), 219 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/98/598/4
--
To view, visit https://asterix-gerrit.ics.uci.edu/598
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I61d00850e0bc8ebc611366b95e2aa4da07d21d55
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hu...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Taewoo Kim <wa...@gmail.com>