You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by dl...@apache.org on 2021/11/02 17:27:09 UTC
[asterixdb] branch master updated: [ASTERIXDB-2839] Fix a bug of
Optmized Spatial Join
This is an automated email from the ASF dual-hosted git repository.
dlych pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
The following commit(s) were added to refs/heads/master by this push:
new 68c2bce [ASTERIXDB-2839] Fix a bug of Optmized Spatial Join
68c2bce is described below
commit 68c2bce77bca0fba949926b77baf7cfd8eab4c3c
Author: Tin Vu <ti...@gmail.com>
AuthorDate: Mon Nov 1 17:50:17 2021 -0700
[ASTERIXDB-2839] Fix a bug of Optmized Spatial Join
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- This merge request fixes a bug in which the Optimized Spatial Join plan is not triggered when the join input type is ARectangle.
Change-Id: I16b0a3ef81214433331aeef364eccdff7d1027bb
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/13905
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>
---
.../org/apache/asterix/optimizer/rules/PullSelectOutOfSpatialJoin.java | 3 ++-
.../java/org/apache/asterix/optimizer/rules/util/SpatialJoinUtils.java | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/PullSelectOutOfSpatialJoin.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/PullSelectOutOfSpatialJoin.java
index 9653793..e395549 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/PullSelectOutOfSpatialJoin.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/PullSelectOutOfSpatialJoin.java
@@ -146,7 +146,8 @@ public class PullSelectOutOfSpatialJoin implements IAlgebraicRewriteRule {
context.getMetadataProvider(), typeEnvironment);
IAType rightType = (IAType) context.getExpressionTypeComputer().getType(f.getArguments().get(1).getValue(),
context.getMetadataProvider(), typeEnvironment);
- if ((leftType != BuiltinType.ARECTANGLE) || (rightType != BuiltinType.ARECTANGLE)) {
+ if ((leftType.getTypeTag() != BuiltinType.ARECTANGLE.getTypeTag())
+ || (rightType.getTypeTag() != BuiltinType.ARECTANGLE.getTypeTag())) {
return false;
}
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/util/SpatialJoinUtils.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/util/SpatialJoinUtils.java
index 16135e5..ca997e0 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/util/SpatialJoinUtils.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/util/SpatialJoinUtils.java
@@ -185,7 +185,8 @@ public class SpatialJoinUtils {
context.getMetadataProvider(), typeEnvironment);
IAType rightType = (IAType) context.getExpressionTypeComputer().getType(spatialJoinRightArg,
context.getMetadataProvider(), typeEnvironment);
- if ((leftType != BuiltinType.ARECTANGLE) || (rightType != BuiltinType.ARECTANGLE)) {
+ if ((leftType.getTypeTag() != BuiltinType.ARECTANGLE.getTypeTag())
+ || (rightType.getTypeTag() != BuiltinType.ARECTANGLE.getTypeTag())) {
return false;
}