You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2021/11/18 01:41:31 UTC

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

From Akil Sevim <ak...@gmail.com>:

Akil Sevim has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )


Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................

[ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins

- user model changes: no
- storage format changes: no
- interface changes: no

Details:

- Fixes the wrong order of record descriptors in optimized spatial and interval join which causes empty results when the projected fields from both sides does not yield the same schema.
- Adds tests for the corresponding fix

Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
---
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
M asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
12 files changed, 188 insertions(+), 6 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/24/14124/1

diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
new file mode 100644
index 0000000..5ba0acb
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * 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;
+USE test;
+
+CREATE TYPE RectangleType AS CLOSED {
+    id: uuid,
+    name: string,
+    g: rectangle
+};
+
+CREATE DATASET RectangleDataset(RectangleType) PRIMARY KEY id AUTOGENERATED;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
new file mode 100644
index 0000000..1876c09
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+INSERT INTO RectangleDataset {"name":"r1", "g":create_rectangle(create_point(0.0,0.0),create_point(1.0,1.0))};
+INSERT INTO RectangleDataset {"name":"r1", "g":create_rectangle(create_point(0.0,0.0),create_point(1.0,1.0))};
+INSERT INTO RectangleDataset {"name":"r2", "g":create_rectangle(create_point(2.0,2.0),create_point(3.0,3.0))};
+INSERT INTO RectangleDataset {"name":"r2", "g":create_rectangle(create_point(2.0,2.0),create_point(3.0,3.0))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
new file mode 100644
index 0000000..0562cfa
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+SELECT r1.name
+FROM RectangleDataset r1, RectangleDataset r2
+WHERE spatial_intersect(r1.g, r2.g) AND r1.id > r2.id
+ORDER BY r1.name;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
index 4f77d69..2547e7f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
@@ -249,6 +249,11 @@
         <output-dir compare="Text">interval_starts</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="temporal/interval_joins">
+      <compilation-unit name="interval_join_projection_check">
+        <output-dir compare="Text">interval_join_projection_check</output-dir>
+      </compilation-unit>
+    </test-case>
     <test-case FilePath="temporal/interval_joins_spilling">
       <compilation-unit name="interval_after">
         <output-dir compare="Text">interval_after</output-dir>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
new file mode 100644
index 0000000..c403987
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * 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;
+USE test;
+
+CREATE TYPE IntervalType AS CLOSED {
+    id: uuid,
+    name: string,
+    i:interval
+};
+
+CREATE DATASET IntervalDataset(IntervalType) PRIMARY KEY id AUTOGENERATED;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
new file mode 100644
index 0000000..bcc3f98
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+INSERT INTO IntervalDataset {
+"name":"i1","i":interval(date("2020-11-06"), date("2020-11-22"))
+};
+INSERT INTO IntervalDataset {
+"name":"i1","i":interval(date("2020-11-06"), date("2020-11-22"))
+};
+INSERT INTO IntervalDataset {
+"name":"i2","i":interval(date("2021-11-06"), date("2021-11-22"))
+};
+INSERT INTO IntervalDataset {
+"name":"i2","i":interval(date("2021-11-06"), date("2021-11-22"))
+};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
new file mode 100644
index 0000000..33c5735
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+SELECT i1.name
+FROM IntervalDataset i1, IntervalDataset i2
+WHERE /*+ range [date("2020-11-06"), date("2021-11-22")] */ interval_overlapping(i1.i, i2.i) AND i1.id > i2.id
+ORDER BY i1.name;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
new file mode 100644
index 0000000..0d54a0e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
@@ -0,0 +1,2 @@
+{ "name": "r1" }
+{ "name": "r2" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
new file mode 100644
index 0000000..2f9f3fc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
@@ -0,0 +1,2 @@
+{ "name": "i1" }
+{ "name": "i2" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index b992c4c..835aecd 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -10150,6 +10150,11 @@
         <output-dir compare="Text">spatial_left_outer_join_st_intersects</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="spatial_join_projection_check">
+        <output-dir compare="Text">spatial_join_projection_check</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="sql-compat">
     <test-case FilePath="sql-compat">
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
index 0417ee0..555df04 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
@@ -99,8 +99,8 @@
         @Override
         public IOperatorNodePushable createPushRuntime(final IHyracksTaskContext ctx,
                 IRecordDescriptorProvider recordDescProvider, final int partition, int nPartitions) {
-            final RecordDescriptor rd0 = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
-            final RecordDescriptor rd1 = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
+            final RecordDescriptor probeRd = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
+            final RecordDescriptor buildRd = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
 
             return new AbstractUnaryInputSinkOperatorNodePushable() {
                 private JoinCacheTaskState state;
@@ -112,7 +112,7 @@
 
                     IIntervalJoinUtil imjc = imjcf.createIntervalMergeJoinUtil(buildKey, probeKey, ctx, nPartitions);
 
-                    state.joiner = new IntervalMergeJoiner(ctx, memoryForJoin, imjc, buildKey, probeKey, rd0, rd1);
+                    state.joiner = new IntervalMergeJoiner(ctx, memoryForJoin, imjc, buildKey, probeKey, buildRd, probeRd);
                 }
 
                 @Override
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
index f804d60..cf44aa9 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
@@ -98,8 +98,8 @@
         @Override
         public IOperatorNodePushable createPushRuntime(final IHyracksTaskContext ctx,
                 IRecordDescriptorProvider recordDescProvider, final int partition, int nPartitions) {
-            final RecordDescriptor rd0 = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
-            final RecordDescriptor rd1 = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
+            final RecordDescriptor probeRd = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
+            final RecordDescriptor buildRd = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
 
             return new AbstractUnaryInputSinkOperatorNodePushable() {
                 private JoinCacheTaskState state;
@@ -111,7 +111,7 @@
 
                     ISpatialJoinUtil imjc = imjcf.createSpatialJoinUtil(buildKeys, probeKeys, ctx, nPartitions);
 
-                    state.joiner = new SpatialJoiner(ctx, memoryForJoin, imjc, buildKeys, probeKeys, rd0, rd1);
+                    state.joiner = new SpatialJoiner(ctx, memoryForJoin, imjc, buildKeys, probeKeys, buildRd, probeRd);
                 }
 
                 @Override

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 1
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-MessageType: newchange

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Jenkins <je...@fulliautomatix.ics.uci.edu>:

Jenkins has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )

Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................


Patch Set 4: Integration-Tests+1

Integration Tests Successful

https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/12745/ : SUCCESS


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 4
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Ian Maxon <im...@uci.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Comment-Date: Mon, 22 Nov 2021 17:53:13 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Akil Sevim <ak...@gmail.com>:

Akil Sevim has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )


Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................

[ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins

- user model changes: no
- storage format changes: no
- interface changes: no

Details:

- Fixes the wrong order of record descriptors in optimized spatial and interval join which causes empty results when the projected fields from both sides does not yield the same schema.
- Adds tests for the corresponding fix

Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
---
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
M asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
12 files changed, 188 insertions(+), 6 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/24/14124/1

diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
new file mode 100644
index 0000000..5ba0acb
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * 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;
+USE test;
+
+CREATE TYPE RectangleType AS CLOSED {
+    id: uuid,
+    name: string,
+    g: rectangle
+};
+
+CREATE DATASET RectangleDataset(RectangleType) PRIMARY KEY id AUTOGENERATED;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
new file mode 100644
index 0000000..1876c09
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+INSERT INTO RectangleDataset {"name":"r1", "g":create_rectangle(create_point(0.0,0.0),create_point(1.0,1.0))};
+INSERT INTO RectangleDataset {"name":"r1", "g":create_rectangle(create_point(0.0,0.0),create_point(1.0,1.0))};
+INSERT INTO RectangleDataset {"name":"r2", "g":create_rectangle(create_point(2.0,2.0),create_point(3.0,3.0))};
+INSERT INTO RectangleDataset {"name":"r2", "g":create_rectangle(create_point(2.0,2.0),create_point(3.0,3.0))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
new file mode 100644
index 0000000..0562cfa
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+SELECT r1.name
+FROM RectangleDataset r1, RectangleDataset r2
+WHERE spatial_intersect(r1.g, r2.g) AND r1.id > r2.id
+ORDER BY r1.name;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
index 4f77d69..2547e7f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
@@ -249,6 +249,11 @@
         <output-dir compare="Text">interval_starts</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="temporal/interval_joins">
+      <compilation-unit name="interval_join_projection_check">
+        <output-dir compare="Text">interval_join_projection_check</output-dir>
+      </compilation-unit>
+    </test-case>
     <test-case FilePath="temporal/interval_joins_spilling">
       <compilation-unit name="interval_after">
         <output-dir compare="Text">interval_after</output-dir>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
new file mode 100644
index 0000000..c403987
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * 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;
+USE test;
+
+CREATE TYPE IntervalType AS CLOSED {
+    id: uuid,
+    name: string,
+    i:interval
+};
+
+CREATE DATASET IntervalDataset(IntervalType) PRIMARY KEY id AUTOGENERATED;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
new file mode 100644
index 0000000..bcc3f98
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+INSERT INTO IntervalDataset {
+"name":"i1","i":interval(date("2020-11-06"), date("2020-11-22"))
+};
+INSERT INTO IntervalDataset {
+"name":"i1","i":interval(date("2020-11-06"), date("2020-11-22"))
+};
+INSERT INTO IntervalDataset {
+"name":"i2","i":interval(date("2021-11-06"), date("2021-11-22"))
+};
+INSERT INTO IntervalDataset {
+"name":"i2","i":interval(date("2021-11-06"), date("2021-11-22"))
+};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
new file mode 100644
index 0000000..33c5735
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+SELECT i1.name
+FROM IntervalDataset i1, IntervalDataset i2
+WHERE /*+ range [date("2020-11-06"), date("2021-11-22")] */ interval_overlapping(i1.i, i2.i) AND i1.id > i2.id
+ORDER BY i1.name;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
new file mode 100644
index 0000000..0d54a0e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
@@ -0,0 +1,2 @@
+{ "name": "r1" }
+{ "name": "r2" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
new file mode 100644
index 0000000..2f9f3fc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
@@ -0,0 +1,2 @@
+{ "name": "i1" }
+{ "name": "i2" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index b992c4c..835aecd 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -10150,6 +10150,11 @@
         <output-dir compare="Text">spatial_left_outer_join_st_intersects</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="spatial_join_projection_check">
+        <output-dir compare="Text">spatial_join_projection_check</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="sql-compat">
     <test-case FilePath="sql-compat">
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
index 0417ee0..555df04 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
@@ -99,8 +99,8 @@
         @Override
         public IOperatorNodePushable createPushRuntime(final IHyracksTaskContext ctx,
                 IRecordDescriptorProvider recordDescProvider, final int partition, int nPartitions) {
-            final RecordDescriptor rd0 = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
-            final RecordDescriptor rd1 = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
+            final RecordDescriptor probeRd = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
+            final RecordDescriptor buildRd = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
 
             return new AbstractUnaryInputSinkOperatorNodePushable() {
                 private JoinCacheTaskState state;
@@ -112,7 +112,7 @@
 
                     IIntervalJoinUtil imjc = imjcf.createIntervalMergeJoinUtil(buildKey, probeKey, ctx, nPartitions);
 
-                    state.joiner = new IntervalMergeJoiner(ctx, memoryForJoin, imjc, buildKey, probeKey, rd0, rd1);
+                    state.joiner = new IntervalMergeJoiner(ctx, memoryForJoin, imjc, buildKey, probeKey, buildRd, probeRd);
                 }
 
                 @Override
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
index f804d60..cf44aa9 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
@@ -98,8 +98,8 @@
         @Override
         public IOperatorNodePushable createPushRuntime(final IHyracksTaskContext ctx,
                 IRecordDescriptorProvider recordDescProvider, final int partition, int nPartitions) {
-            final RecordDescriptor rd0 = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
-            final RecordDescriptor rd1 = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
+            final RecordDescriptor probeRd = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
+            final RecordDescriptor buildRd = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
 
             return new AbstractUnaryInputSinkOperatorNodePushable() {
                 private JoinCacheTaskState state;
@@ -111,7 +111,7 @@
 
                     ISpatialJoinUtil imjc = imjcf.createSpatialJoinUtil(buildKeys, probeKeys, ctx, nPartitions);
 
-                    state.joiner = new SpatialJoiner(ctx, memoryForJoin, imjc, buildKeys, probeKeys, rd0, rd1);
+                    state.joiner = new SpatialJoiner(ctx, memoryForJoin, imjc, buildKeys, probeKeys, buildRd, probeRd);
                 }
 
                 @Override

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 1
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-MessageType: newchange

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
Anon. E. Moose #1000171 has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )

Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................


Patch Set 4: Contrib-2

Analytics Compatibility Tests Failed
https://cbjenkins.page.link/PmiECdnDe9AM3VkW8 : UNSTABLE


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 4
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Ian Maxon <im...@uci.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Comment-Date: Mon, 22 Nov 2021 19:21:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
Anon. E. Moose #1000171 has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )

Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................


Patch Set 3:

Analytics Compatibility Compilation Successful
https://cbjenkins.page.link/hQeLonKfHjMtP7HB9 : SUCCESS


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 3
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Ian Maxon <im...@uci.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Comment-Date: Fri, 19 Nov 2021 21:45:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Preston Carman <pr...@apache.org>:

Preston Carman has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )

Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................


Patch Set 1: Code-Review+1

(1 comment)

Only one question about your test query. Just wondering if it is as simple as possible.

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124/1/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp 
File asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124/1/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp@24 
PS1, Line 24: AND
Is this `AND i1.id > i2.id` needed in the query? Can you get the same error without it?



-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 1
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Comment-Date: Thu, 18 Nov 2021 04:53:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Ian Maxon <im...@uci.edu>:

Ian Maxon has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )

Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................


Patch Set 4: Code-Review+2


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 4
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Ian Maxon <im...@uci.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Comment-Date: Mon, 22 Nov 2021 20:32:40 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
Anon. E. Moose #1000171 has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )

Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................


Patch Set 4:

Analytics Compatibility Compilation Successful
https://cbjenkins.page.link/UqEaYe1pEw6YHoxn7 : SUCCESS


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 4
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Ian Maxon <im...@uci.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-Comment-Date: Mon, 22 Nov 2021 16:57:15 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Akil Sevim <ak...@gmail.com>:

Akil Sevim has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )

Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................


Patch Set 1:

Hello Preston,

I have created a patch for the bug fix and added you as a reviewer. If you could review the changes I would be a appreciated. 

Also, please let me know if I need to add more reviewers and if you have any suggestions.

Best regards,

Akil.


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 1
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@gmail.com>
Gerrit-CC: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Comment-Date: Thu, 18 Nov 2021 01:44:51 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Akil Sevim <ak...@gmail.com>:

Hello Preston Carman, Jenkins, Anon. E. Moose #1000171, Preston Carman, 

I'd like you to reexamine a change. Please visit

    https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124

to look at the new patch set (#2).

Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................

[ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins

- user model changes: no
- storage format changes: no
- interface changes: no

Details:

- Fixes the wrong order of record descriptors in optimized spatial and interval join which causes empty results when the projected fields from both sides does not yield the same schema.
- Adds tests for the corresponding fix

Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
---
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
M asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
12 files changed, 200 insertions(+), 6 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/24/14124/2
-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 2
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-MessageType: newpatchset

Change in asterixdb[master]: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spat...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Ian Maxon <im...@uci.edu>:

Ian Maxon has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124 )

Change subject: [ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins
......................................................................

[ASTERIXDB-2987] Fixes the wrong order of record descriptors for spatial and interval joins

- user model changes: no
- storage format changes: no
- interface changes: no

Details:

- Fixes the wrong order of record descriptors in optimized spatial and interval join which causes empty results when the projected fields from both sides does not yield the same schema.
- Adds tests for the corresponding fix

Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Contrib: Ian Maxon <im...@uci.edu>
Reviewed-by: Ian Maxon <im...@uci.edu>
---
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
M asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
12 files changed, 201 insertions(+), 6 deletions(-)

Approvals:
  Ian Maxon: Looks good to me, approved; 
  Jenkins: Verified; Verified



diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
new file mode 100644
index 0000000..5ba0acb
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.1.ddl.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * 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;
+USE test;
+
+CREATE TYPE RectangleType AS CLOSED {
+    id: uuid,
+    name: string,
+    g: rectangle
+};
+
+CREATE DATASET RectangleDataset(RectangleType) PRIMARY KEY id AUTOGENERATED;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
new file mode 100644
index 0000000..1876c09
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.2.update.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+INSERT INTO RectangleDataset {"name":"r1", "g":create_rectangle(create_point(0.0,0.0),create_point(1.0,1.0))};
+INSERT INTO RectangleDataset {"name":"r1", "g":create_rectangle(create_point(0.0,0.0),create_point(1.0,1.0))};
+INSERT INTO RectangleDataset {"name":"r2", "g":create_rectangle(create_point(2.0,2.0),create_point(3.0,3.0))};
+INSERT INTO RectangleDataset {"name":"r2", "g":create_rectangle(create_point(2.0,2.0),create_point(3.0,3.0))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
new file mode 100644
index 0000000..d07707c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/spatial/spatial_join_projection_check/spatial_join_projection_check.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+SELECT r1.name
+FROM RectangleDataset r1, RectangleDataset r2
+WHERE spatial_intersect(r1.g, r2.g)
+ORDER BY r1.name;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
index 4f77d69..2547e7f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/TemporalQueries.xml
@@ -249,6 +249,11 @@
         <output-dir compare="Text">interval_starts</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="temporal/interval_joins">
+      <compilation-unit name="interval_join_projection_check">
+        <output-dir compare="Text">interval_join_projection_check</output-dir>
+      </compilation-unit>
+    </test-case>
     <test-case FilePath="temporal/interval_joins_spilling">
       <compilation-unit name="interval_after">
         <output-dir compare="Text">interval_after</output-dir>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
new file mode 100644
index 0000000..c403987
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.ddl.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * 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;
+USE test;
+
+CREATE TYPE IntervalType AS CLOSED {
+    id: uuid,
+    name: string,
+    i:interval
+};
+
+CREATE DATASET IntervalDataset(IntervalType) PRIMARY KEY id AUTOGENERATED;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
new file mode 100644
index 0000000..bcc3f98
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.2.update.sqlpp
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+INSERT INTO IntervalDataset {
+"name":"i1","i":interval(date("2020-11-06"), date("2020-11-22"))
+};
+INSERT INTO IntervalDataset {
+"name":"i1","i":interval(date("2020-11-06"), date("2020-11-22"))
+};
+INSERT INTO IntervalDataset {
+"name":"i2","i":interval(date("2021-11-06"), date("2021-11-22"))
+};
+INSERT INTO IntervalDataset {
+"name":"i2","i":interval(date("2021-11-06"), date("2021-11-22"))
+};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
new file mode 100644
index 0000000..6bf7c95
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+SELECT i1.name
+FROM IntervalDataset i1, IntervalDataset i2
+WHERE /*+ range [date("2020-11-06"), date("2021-11-22")] */ interval_overlapping(i1.i, i2.i)
+ORDER BY i1.name;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
new file mode 100644
index 0000000..3272f31
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/spatial/spatial_join_projection_check/spatial_join_projection_check.1.adm
@@ -0,0 +1,8 @@
+{ "name": "r1" }
+{ "name": "r1" }
+{ "name": "r1" }
+{ "name": "r1" }
+{ "name": "r2" }
+{ "name": "r2" }
+{ "name": "r2" }
+{ "name": "r2" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
new file mode 100644
index 0000000..a105d6e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/temporal/interval_joins/interval_join_projection_check/interval_join_projection_check.1.adm
@@ -0,0 +1,8 @@
+{ "name": "i1" }
+{ "name": "i1" }
+{ "name": "i1" }
+{ "name": "i1" }
+{ "name": "i2" }
+{ "name": "i2" }
+{ "name": "i2" }
+{ "name": "i2" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index cca0d63..cbde37e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -10150,6 +10150,11 @@
         <output-dir compare="Text">spatial_left_outer_join_st_intersects</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="spatial_join_projection_check">
+        <output-dir compare="Text">spatial_join_projection_check</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="sql-compat">
     <test-case FilePath="sql-compat">
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
index 0417ee0..fdcee13 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/interval/IntervalMergeJoinOperatorDescriptor.java
@@ -99,8 +99,8 @@
         @Override
         public IOperatorNodePushable createPushRuntime(final IHyracksTaskContext ctx,
                 IRecordDescriptorProvider recordDescProvider, final int partition, int nPartitions) {
-            final RecordDescriptor rd0 = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
-            final RecordDescriptor rd1 = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
+            final RecordDescriptor probeRd = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
+            final RecordDescriptor buildRd = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
 
             return new AbstractUnaryInputSinkOperatorNodePushable() {
                 private JoinCacheTaskState state;
@@ -112,7 +112,8 @@
 
                     IIntervalJoinUtil imjc = imjcf.createIntervalMergeJoinUtil(buildKey, probeKey, ctx, nPartitions);
 
-                    state.joiner = new IntervalMergeJoiner(ctx, memoryForJoin, imjc, buildKey, probeKey, rd0, rd1);
+                    state.joiner =
+                            new IntervalMergeJoiner(ctx, memoryForJoin, imjc, buildKey, probeKey, buildRd, probeRd);
                 }
 
                 @Override
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
index f804d60..cf44aa9 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/joins/spatial/PlaneSweepJoinOperatorDescriptor.java
@@ -98,8 +98,8 @@
         @Override
         public IOperatorNodePushable createPushRuntime(final IHyracksTaskContext ctx,
                 IRecordDescriptorProvider recordDescProvider, final int partition, int nPartitions) {
-            final RecordDescriptor rd0 = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
-            final RecordDescriptor rd1 = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
+            final RecordDescriptor probeRd = recordDescProvider.getInputRecordDescriptor(nljAid, 0);
+            final RecordDescriptor buildRd = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
 
             return new AbstractUnaryInputSinkOperatorNodePushable() {
                 private JoinCacheTaskState state;
@@ -111,7 +111,7 @@
 
                     ISpatialJoinUtil imjc = imjcf.createSpatialJoinUtil(buildKeys, probeKeys, ctx, nPartitions);
 
-                    state.joiner = new SpatialJoiner(ctx, memoryForJoin, imjc, buildKeys, probeKeys, rd0, rd1);
+                    state.joiner = new SpatialJoiner(ctx, memoryForJoin, imjc, buildKeys, probeKeys, buildRd, probeRd);
                 }
 
                 @Override

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14124
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I4f7186459a490beaac08624e7a5cbe09734a82ad
Gerrit-Change-Number: 14124
Gerrit-PatchSet: 5
Gerrit-Owner: Akil Sevim <ak...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Ian Maxon <im...@uci.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Preston Carman <pr...@gmail.com>
Gerrit-Reviewer: Preston Carman <pr...@apache.org>
Gerrit-MessageType: merged