arina-ielchiieva commented on a change in pull request #1871: DRILL-7403:
lidate batch checks, vector integretity in unit tests
URL: https://github.com/apache/drill/pull/1871#discussion_r334633755
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/validate/BatchValidator.java
##########
@@ -101,47 +290,90 @@ private void validateVector(ValueVector vector) {
}
}
- private void validateVariableWidthVector(String name, VariableWidthVector
vector, int entryCount) {
+ private void validateNullableVector(String name, NullableVector vector) {
+ int outerCount = vector.getAccessor().getValueCount();
+ ValueVector valuesVector = vector.getValuesVector();
+ int valueCount = valuesVector.getAccessor().getValueCount();
+ if (valueCount != outerCount) {
+ error(name, vector, String.format(
+ "Outer value count = %d, but inner value count = %d",
+ outerCount, valueCount));
+ }
+ verifyIsSetVector(vector, (UInt1Vector) vector.getBitsVector());
+ validateVector(name + "-values", valuesVector);
+ }
+
+ private void validateVariableWidthVector(String name, VariableWidthVector
vector) {
// Offsets are in the derived classes. Handle only VarChar for now.
if (vector instanceof VarCharVector) {
- validateVarCharVector(name, (VarCharVector) vector, entryCount);
+ validateVarCharVector(name, (VarCharVector) vector);
} else {
logger.debug("Don't know how to validate vector: " + name + " of class "
+ vector.getClass().getSimpleName());
Review comment:
Know it's not your code but since I saw this, could you please fix:
```suggestion
logger.debug("Don't know how to validate vector: {} of class {}",
name, vector.getClass().getSimpleName());
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services