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_r334628847
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/validate/BatchValidator.java
##########
@@ -48,50 +52,235 @@
private static final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(BatchValidator.class);
+ public static final boolean LOG_TO_STDOUT = true;
public static final int MAX_ERRORS = 100;
- private final int rowCount;
- private final VectorAccessible batch;
- private final List<String> errorList;
- private int errorCount;
+ public interface ErrorReporter {
+ void error(String name, ValueVector vector, String msg);
+ void warn(String name, ValueVector vector, String msg);
+ void error(String msg);
+ int errorCount();
+ }
+
+ public abstract static class BaseErrorReporter implements ErrorReporter {
+
+ private final String opName;
+ private int errorCount;
+
+ public BaseErrorReporter(String opName) {
+ this.opName = opName;
+ }
+
+ protected boolean startError() {
+ if (errorCount == 0) {
+ logger.error("Found one or more vector errors from " + opName);
Review comment:
```suggestion
logger.error("Found one or more vector errors from {}", opName);
```
----------------------------------------------------------------
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