You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/03/23 23:19:02 UTC

[GitHub] [pinot] amrishlal commented on a change in pull request #8394: Fix ingestion transform config bugs.

amrishlal commented on a change in pull request #8394:
URL: https://github.com/apache/pinot/pull/8394#discussion_r833796223



##########
File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/recordtransformer/ExpressionTransformer.java
##########
@@ -40,12 +41,18 @@
  */
 public class ExpressionTransformer implements RecordTransformer {
 
-  private final LinkedHashMap<String, FunctionEvaluator> _expressionEvaluators = new LinkedHashMap<>();
+  @VisibleForTesting
+  final LinkedHashMap<String, FunctionEvaluator> _expressionEvaluators = new LinkedHashMap<>();
 
   public ExpressionTransformer(TableConfig tableConfig, Schema schema) {
     Map<String, FunctionEvaluator> expressionEvaluators = new HashMap<>();
     if (tableConfig.getIngestionConfig() != null && tableConfig.getIngestionConfig().getTransformConfigs() != null) {
       for (TransformConfig transformConfig : tableConfig.getIngestionConfig().getTransformConfigs()) {
+        String columnName = transformConfig.getColumnName();
+        if (expressionEvaluators.containsKey(columnName)) {
+          throw new RuntimeException("Cannot set more than one ingestion transform function on a column (column name: "
+              + "'" + columnName + "').");
+        }

Review comment:
       Fixed.




-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org