This plugin provides a Convergence Query (CQ) function for use in Apache IoTDB, allowing analysis of time series compounds directly via SQL using a UDF.
- Clone and build the plugin:
mvn clean package- Locate the built JAR:
- For maven:
target/tsc-cq-iotdb-plugin-1.0-SNAPSHOT-shaded.jar
- Copy the JAR to IoTDB's UDF lib directory:
cp target/tsc-cq-iotdb-plugin-1.0-SNAPSHOT-shaded.jar $IOTDB_HOME/ext/udf/-
Start or restart IoTDB if running.
-
Register the UDF:
--- For index
CREATE FUNCTION tsc_create_index AS "edu.wpi.tsc.cq.plugin.iotdb.TscCreateIndexUDTF";
--- For query
CREATE FUNCTION tsc_convergence AS 'edu.wpi.tsc.cq.plugin.iotdb.TscCQueryUDTF';- Example SQL usage inside IoTDB to build the index:
SELECT tsc_create_index(
*,
'scope'='root.sg1.**',
'hdfs_uri'='hdfs://localhost:9000/user/kalnuaim',
'hdfs_path'='/home/kalnuaim/hadoop/bin/hdfs',
'spark_submit'='/home/kalnuaim/spark/bin/spark-submit',
'spark_master'='local[*]',
'tsc_jar'='/home/kalnuaim/cq.jar',
'index_conf'='/home/kalnuaim/indexConfig.conf',
'debug'='true'
) FROM root.sg1.**- Example SQL usage inside IoTDB to query:
SELECT tsc_convergence(
sensor1,
'scope'='root.sg1.device1.sensor1',
'hdfs_uri'='hdfs://localhost:9000/user/kalnuaim',
'hdfs_path'='/home/kalnuaim/hadoop/bin/hdfs',
'spark_submit'='/home/kalnuaim/spark/bin/spark-submit',
'spark_master'='local[*]',
'tsc_jar'='/home/kalnuaim/cq.jar',
'index_conf'='/home/kalnuaim/indexConfig.conf',
'query_conf'='/home/kalnuaim/queryConfig.conf',
'dataset'='tsc_data_bfda5785f81373829e12555ace44bca53445b2da12f910ef5d87f0450ee457d6',
'debug'='true'
) FROM root.sg1.device1;