Github user jacques-n commented on a diff in the pull request:
https://github.com/apache/drill/pull/257#discussion_r44883050
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/record/BatchSchema.java ---
@@ -113,10 +115,45 @@ public boolean equals(Object obj) {
} else if (!fields.equals(other.fields)) {
return false;
}
+ for (int i = 0; i < fields.size(); i++) {
+ MajorType t1 = fields.get(i).getType();
+ MajorType t2 = other.fields.get(i).getType();
+ if (t1 == null) {
+ if (t2 != null) {
+ return false;
+ }
+ } else {
+ if (!majorTypeEqual(t1, t2)) {
+ return false;
+ }
+ }
+ }
if (selectionVectorMode != other.selectionVectorMode) {
return false;
}
return true;
}
+ /**
+ * We treat fields with same set of Subtypes as equal, even if they are
in a different order
+ * @param t1
+ * @param t2
+ * @return
+ */
+ private boolean majorTypeEqual(MajorType t1, MajorType t2) {
--- End diff --
A better function name would be good here. maybe
majorTypeSubfieldSetsAreEqual?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---