Package org.apache.iotdb.udf
Class UDTFExample
- java.lang.Object
-
- org.apache.iotdb.udf.UDTFExample
-
- All Implemented Interfaces:
org.apache.iotdb.udf.api.UDF,org.apache.iotdb.udf.api.UDTF
public class UDTFExample extends Object implements org.apache.iotdb.udf.api.UDTF
This is an internal example of the UDTF implementation.
-
-
Constructor Summary
Constructors Constructor Description UDTFExample()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeStart(org.apache.iotdb.udf.api.customizer.parameter.UDFParameters parameters, org.apache.iotdb.udf.api.customizer.config.UDTFConfigurations configurations)voidtransform(org.apache.iotdb.udf.api.access.Row row, org.apache.iotdb.udf.api.collector.PointCollector collector)voidvalidate(org.apache.iotdb.udf.api.customizer.parameter.UDFParameterValidator validator)CREATE DATABASE root.sg1; CREATE TIMESERIES root.sg1.d1.s1 WITH DATATYPE=INT32, ENCODING=PLAIN; CREATE TIMESERIES root.sg1.d1.s2 WITH DATATYPE=INT32, ENCODING=PLAIN; INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (0, -1, 1); INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (1, -2, 2); INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (2, -3, 3);
-
-
-
Method Detail
-
validate
public void validate(org.apache.iotdb.udf.api.customizer.parameter.UDFParameterValidator validator) throws ExceptionCREATE DATABASE root.sg1; CREATE TIMESERIES root.sg1.d1.s1 WITH DATATYPE=INT32, ENCODING=PLAIN; CREATE TIMESERIES root.sg1.d1.s2 WITH DATATYPE=INT32, ENCODING=PLAIN; INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (0, -1, 1); INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (1, -2, 2); INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (2, -3, 3);CREATE FUNCTION example AS 'org.apache.iotdb.udf.UDTFExample'; SHOW FUNCTIONS; SELECT s1, example(s1), s2, example(s2) FROM root.sg1.d1;
- Specified by:
validatein interfaceorg.apache.iotdb.udf.api.UDF- Throws:
Exception
-
beforeStart
public void beforeStart(org.apache.iotdb.udf.api.customizer.parameter.UDFParameters parameters, org.apache.iotdb.udf.api.customizer.config.UDTFConfigurations configurations)- Specified by:
beforeStartin interfaceorg.apache.iotdb.udf.api.UDTF
-
transform
public void transform(org.apache.iotdb.udf.api.access.Row row, org.apache.iotdb.udf.api.collector.PointCollector collector) throws IOException- Specified by:
transformin interfaceorg.apache.iotdb.udf.api.UDTF- Throws:
IOException
-
-