Skip to content

kaluaim/tsc-cq-iotdb-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IoTDB Convergence Query Plugin

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.


🔧 Build Instructions

  1. Clone and build the plugin:
mvn clean package
  1. Locate the built JAR:
  • For maven: target/tsc-cq-iotdb-plugin-1.0-SNAPSHOT-shaded.jar

📦 Deploy to IoTDB

  1. Copy the JAR to IoTDB's UDF lib directory:
cp target/tsc-cq-iotdb-plugin-1.0-SNAPSHOT-shaded.jar $IOTDB_HOME/ext/udf/
  1. Start or restart IoTDB if running.

  2. 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';

▶️ Run the Function

  • 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;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages