emkornfield commented on a change in pull request #12294:
URL: https://github.com/apache/arrow/pull/12294#discussion_r800131956
##########
File path:
java/vector/src/main/java/org/apache/arrow/vector/validate/ValidateVectorTypeVisitor.java
##########
@@ -116,6 +116,25 @@ private void validateDateVector(ValueVector vector,
DateUnit expectedDateUnit) {
"Expecting date unit %s, actual date unit %s.", expectedDateUnit,
dateType.getUnit());
}
+ private void validateDecimalVector(ValueVector vector) {
+ validateOrThrow(vector.getField().getFieldType().getType() instanceof
ArrowType.Decimal,
+ "Vector %s is not a decimal vector", vector.getClass());
+ ArrowType.Decimal decimalType = (ArrowType.Decimal)
vector.getField().getFieldType().getType();
+ validateOrThrow(decimalType.getScale() >= 0, "The scale of decimal %s is
negative.", decimalType.getScale());
Review comment:
we should also validate scale is less then or equal to precision.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]