tanmesh commented on code in PR #9184: URL: https://github.com/apache/pinot/pull/9184#discussion_r954281226
########## pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/ExtractTransformFunction.java: ########## @@ -0,0 +1,97 @@ +package org.apache.pinot.core.operator.transform.function; + +import java.util.List; +import java.util.Map; +import org.apache.pinot.core.operator.blocks.ProjectionBlock; +import org.apache.pinot.core.operator.transform.TransformResultMetadata; +import org.apache.pinot.segment.spi.datasource.DataSource; +import org.joda.time.Chronology; +import org.joda.time.DateTimeField; +import org.joda.time.chrono.ISOChronology; + + +public class ExtractTransformFunction extends BaseTransformFunction { + public static final String FUNCTION_NAME = "extract"; + private TransformFunction _mainTransformFunction; + protected String _field; + protected Chronology _chronology = ISOChronology.getInstanceUTC(); + + @Override + public String getName() { return FUNCTION_NAME; } + + @Override + public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) { + if (arguments.size() != 2) { + throw new IllegalArgumentException("Exactly 2 arguments are required for EXTRACT transform function"); + } + + _field = ((LiteralTransformFunction) arguments.get(0)).getLiteral(); + if(!validField(_field)) { Review Comment: Thanks! I wanted to bring to your notice that original code is also getting reformatted while using the Pinot Style. -- 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-unsubscr...@pinot.apache.org 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