npawar commented on a change in pull request #5934: URL: https://github.com/apache/incubator-pinot/pull/5934#discussion_r479437446
########## File path: pinot-core/src/main/java/org/apache/pinot/core/segment/processing/transformer/TransformFunctionRecordTransformer.java ########## @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.pinot.core.segment.processing.transformer; + +import java.util.HashMap; +import java.util.Map; +import org.apache.pinot.core.data.function.FunctionEvaluator; +import org.apache.pinot.core.data.function.FunctionEvaluatorFactory; +import org.apache.pinot.spi.data.readers.GenericRow; + + +/** + * RecordTransformer which executes transform functions to transform columns of record + * Does not follow any particular order, and hence cannot support transformations where strict order of execution is needed + */ +public class TransformFunctionRecordTransformer implements RecordTransformer { + + private final Map<String, FunctionEvaluator> _functionEvaluatorMap = new HashMap<>(); + + public TransformFunctionRecordTransformer(Map<String, String> transformFunctionMap) { Review comment: Several options: 1. Use Groovy function to write any logic 2. Add the function with @ScalarFunction annotation and put the jar in plugins dir 3. Introduce new RecordTransformer implementation, introduce RecordTransformerType and change factory logic I did not do the option 3 right now, because I think 1 and 2 should suffice most times. If we see the demand for 3, we can add it. Will put a TODO ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org