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

Syntax error when specifying placeholders in create view statement.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • None
    • mpp-cluster

    Description

      测试版本:iotdb_master_0601_81f541d
      有2个问题:
      cli执行报错不对。
      指定占位符 ,创建view 不成功。
      研发功能定义文档描述:

      实际创建失败,测试用例:
      drop database root.db;
      drop database root.view;
      create database root.db;
      create database root.view;
      create timeseries root.db.d01.temperature with datatype=INT32;
      create timeseries root.db.d01.speed with datatype=INT64;
      create timeseries root.db.d02.temperature with datatype=INT32;
      create timeseries root.db.d02.s02 with datatype=INT64;
      create timeseries root.db.d02.s03 with datatype=INT64;

      create timeseries root.db.d03.temperature with datatype=TEXT;
      create timeseries root.db.d03.c02 with datatype=INT64;
      create timeseries root.db.d03.c03 with datatype=INT64;

      create timeseries root.db.d04.temperature with datatype=TEXT;
      create timeseries root.db.d04.d02 with datatype=INT64;
      create timeseries root.db.d04.d03 with datatype=INT64;

      create timeseries root.db.d05.temperature with datatype=float;
      create timeseries root.db.d06.temperature with datatype=double;
      insert into root.db.d01(time,temperature,speed) values(1,20,80);
      insert into root.db.d06(time,temperature) values(1685583924366,30);
      //下面这个语句是在cli中执行,这个bug 需要cli来解决
      CREATE VIEW root.db.view(${2}_temperature) AS SELECT temperature FROM root.db.{*};
      CREATE VIEW root.db.view(${2}_${3}) AS SELECT temperature from root.db.{};{*}

      Msg: 701: ${2}_temperature is illegal, unquoted node name can only consist of digits, characters and underscore, or start or end with wildcard


      // 指定占位符的创建方式,怎么才能执行成功
      ./sbin/start-cli.sh -h 172.20.70.3 -e " CREATE VIEW root.db.view(${2}_temperature) AS SELECT temperature FROM root.db.*;"
      Msg: 300: The number of target and source paths are miss matched! Please check your SQL.

      Attachments

        1. image-2023-06-01-10-06-09-132.png
          52 kB
          刘珍
        2. image-2023-06-01-10-07-36-404.png
          12 kB
          刘珍
        3. screenshot-1.png
          7 kB
          刘珍

        Activity

          People

            Marcoss Yukun Zhou
            刘珍 刘珍
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: