commit | a93f36df22debbdbd5290b4155d23a57b173794a | [log] [tgz] |
---|---|---|
author | Glenn <ggalvizo@uci.edu> | Thu Oct 01 15:20:47 2020 -0700 |
committer | Dmitry Lychagin <dmitry.lychagin@couchbase.com> | Fri Oct 02 18:16:58 2020 +0000 |
tree | c161a1e49ef8898834f9194cf0ebcdb5f3030599 | |
parent | bde7e7781d82c080ebd6b7b0b59a410fd54f2aa2 [diff] |
[NO ISSUE][COMP] Add equivalence support in DISTINCT FD visitor. - user model changes: no - storage format changes: no - interface changes: no Detail: - FD visitor for DISTINCT operator now correctly accounts for equivalent variables. Change-Id: I78d66c65864aeacd1713ee60e7f4d221af0eacd1 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/8206 Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/FDsAndEquivClassesVisitor.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/FDsAndEquivClassesVisitor.java index eaac45d..ccdbd1f 100644 --- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/FDsAndEquivClassesVisitor.java +++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/FDsAndEquivClassesVisitor.java
@@ -189,7 +189,10 @@ if (p2.getExpressionTag() == LogicalExpressionTag.VARIABLE) { VariableReferenceExpression var2 = (VariableReferenceExpression) p2; LogicalVariable v2 = var2.getVariableReference(); - if (normSet.contains(v2)) { + // We must additionally account for equivalent variables. + EquivalenceClass v2EquivalenceClass = equivalenceClasses.get(v2); + if ((v2EquivalenceClass != null && normSet.contains(v2EquivalenceClass.getVariableRepresentative())) + || (v2EquivalenceClass == null && normSet.contains(v2))) { newDistinctByList.add(p2Ref); } } else {