xiangfu0 commented on code in PR #9377:
URL: https://github.com/apache/pinot/pull/9377#discussion_r968124643
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/recordtransformer/FilterTransformer.java:
##########
@@ -22,31 +22,50 @@
import org.apache.pinot.segment.local.function.FunctionEvaluatorFactory;
import org.apache.pinot.spi.config.table.TableConfig;
import org.apache.pinot.spi.data.readers.GenericRow;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Based on filter config, decide whether to skip or allow this record.
* If record should be skipped, puts a special key in the record.
*/
public class FilterTransformer implements RecordTransformer {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(FilterTransformer.class);
+ private String _filterFunction;
private final FunctionEvaluator _evaluator;
+ private final boolean _continueOnError;
public FilterTransformer(TableConfig tableConfig) {
- String filterFunction = null;
+ _filterFunction = null;
+ _continueOnError = tableConfig.getIngestionConfig() != null &&
tableConfig.getIngestionConfig().isContinueOnError();
+
if (tableConfig.getIngestionConfig() != null &&
tableConfig.getIngestionConfig().getFilterConfig() != null) {
- filterFunction =
tableConfig.getIngestionConfig().getFilterConfig().getFilterFunction();
+ _filterFunction =
tableConfig.getIngestionConfig().getFilterConfig().getFilterFunction();
}
- _evaluator = (filterFunction != null) ?
FunctionEvaluatorFactory.getExpressionEvaluator(filterFunction) : null;
+ _evaluator = (_filterFunction != null) ?
FunctionEvaluatorFactory.getExpressionEvaluator(_filterFunction) : null;
}
@Override
public GenericRow transform(GenericRow record) {
if (_evaluator != null) {
- Object result = _evaluator.evaluate(record);
- if (Boolean.TRUE.equals(result)) {
- record.putValue(GenericRow.SKIP_RECORD_KEY, true);
- }
+ try {
Review Comment:
indentation.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]