Skip to content

Commit

Permalink
[ARROW-6738][Java] Compare fields for all vectors except union vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
liyafan82 committed Jan 21, 2020
1 parent 5b2225e commit bab7402
Showing 1 changed file with 0 additions and 18 deletions.
Expand Up @@ -24,15 +24,13 @@
import org.apache.arrow.util.Preconditions;
import org.apache.arrow.vector.BaseFixedWidthVector;
import org.apache.arrow.vector.BaseVariableWidthVector;
import org.apache.arrow.vector.DecimalVector;
import org.apache.arrow.vector.NullVector;
import org.apache.arrow.vector.ValueVector;
import org.apache.arrow.vector.complex.BaseRepeatedValueVector;
import org.apache.arrow.vector.complex.FixedSizeListVector;
import org.apache.arrow.vector.complex.ListVector;
import org.apache.arrow.vector.complex.NonNullableStructVector;
import org.apache.arrow.vector.complex.UnionVector;
import org.apache.arrow.vector.types.pojo.ArrowType;

/**
* Visitor to compare a range of values for vectors.
Expand Down Expand Up @@ -246,23 +244,7 @@ protected boolean compareStructVectors(Range range) {
return true;
}

private boolean compareDecimalVectorTypes() {
ArrowType.Decimal leftType = (ArrowType.Decimal) left.getField().getType();
ArrowType.Decimal rightType = (ArrowType.Decimal) right.getField().getType();

if (leftType.getPrecision() != rightType.getPrecision() || leftType.getScale() != rightType.getScale()) {
return false;
}
return true;
}

protected boolean compareBaseFixedWidthVectors(Range range) {
if (left instanceof DecimalVector) {
if (!compareDecimalVectorTypes()) {
return false;
}
}

BaseFixedWidthVector leftVector = (BaseFixedWidthVector) left;
BaseFixedWidthVector rightVector = (BaseFixedWidthVector) right;

Expand Down

0 comments on commit bab7402

Please sign in to comment.