tanmesh commented on code in PR #9184: URL: https://github.com/apache/pinot/pull/9184#discussion_r951960280
########## pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/ExtractTransformFunction.java: ########## @@ -0,0 +1,91 @@ +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.apache.pinot.spi.data.FieldSpec; +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 _name = "extract"; + private TransformResultMetadata _resultMetadata; + private TransformFunction _mainTranformFunction; + private String[] _stringOutputTimes; + protected String _field; + protected Chronology _chronology = ISOChronology.getInstanceUTC(); + + private static final TransformResultMetadata METADATA = + new TransformResultMetadata(FieldSpec.DataType.INT, true, false); + + @Override + public String getName() { return _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(); Review Comment: Thanks for the suggestion! I have added the change in the latest commit. -- 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