Uploaded image for project: 'Apache IoTDB'
  1. Apache IoTDB
  2. IOTDB-2378

[CQ]支持$变量定义到传感器位(当前实现层数+1)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.13.0-SNAPSHOT
    • None
    • Others

    Description

      (需求)

      数据模式[2个存储组管理30个设备,每个设备30个传感器]

      目前我的时间序列是root.test.g_0.d_0.s_0,在CQ中$因为我写的语句如下

      CREATE CONTINUOUS QUERY cqmax RESAMPLE EVERY 20s FOR 20s BEGIN SELECT max_value(、*) INTO root.cq4.${2}.${3}.maxValue FROM root.test.. GROUP BY time(10s) END

      所以$最大写到${3},如需求是:计算所有传感器的最大值写入时间序列名称为“原传感器名称_maxValue”。目前版本没有找到实现方案。所以是否可以抽象一下$4代表 select 后 from前的位置?

      这样我们就可以支持:

      CREATE CONTINUOUS QUERY cqmax RESAMPLE EVERY 20s FOR 20s BEGIN SELECT max_value(、*) INTO root.cq4.${2}.${3}.${4}_maxValue FROM root.test.. GROUP BY time(10s) END

       

      请参考。

       

       

       

      Attachments

        Activity

          People

            suyurong Steve Yurong Su
            QX.Feng FengQingxin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: