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

The old syntax of the string function substring needs to be removed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Done
    • master branch
    • None
    • mpp-cluster

    Description

      Branch : Master

      commit 40871077555ea07556aba185121bbcf1d12b5d0b
      The following SQL is about V1.1.X, as for new string function 'substring' need to remove, just need to support new grammar rules.

      The old SQL is : (noted: V1.1.x)

      IoTDB> select s4,SUBSTRING(s4, 'start'='0','end'='2') from root.sg.d1;
      +-----------------------------+-------------+-----------------------------+
      |                         Time|root.sg.d1.s4|SUBSTRING(root.sg.d1.s4,null)|
      +-----------------------------+-------------+-----------------------------+
      |1970-01-01T08:00:00.001+08:00|         1731|                         1731|
      |1970-01-01T08:00:00.002+08:00|        0.001|                        0.001|
      |1970-01-01T08:00:00.003+08:00|          111|                          111|
      |1970-01-01T08:00:00.004+08:00|   warn:-8721|                   warn:-8721|
      |1970-01-01T08:00:00.005+08:00| error:-37229|                 error:-37229|
      |1970-01-01T08:00:00.006+08:00|          100|                          100|
      |1970-01-01T08:00:00.007+08:00|        FALSE|                        FALSE|
      |1970-01-01T08:00:00.008+08:00|   warn:-8721|                   warn:-8721|
      |1970-01-01T08:00:00.009+08:00|        false|                        false|
      |1970-01-01T08:00:00.010+08:00|         true|                         true|
      |1970-01-01T08:00:00.011+08:00|     -37229.1|                     -37229.1|
      |1970-01-01T08:00:00.012+08:00|        false|                        false|
      +-----------------------------+-------------+-----------------------------+
      Total line number = 12
      It costs 0.006s 

      The new SQL is :

      IoTDB> select s4, substring(s4,3,2) from root.sg.d1;
      +-----------------------------+-------------+----------------------------+
      |                         Time|root.sg.d1.s4|SUBSTRING(root.sg.d1.s4,3,2)|
      +-----------------------------+-------------+----------------------------+
      |1970-01-01T08:00:00.001+08:00|         1731|                          31|
      |1970-01-01T08:00:00.002+08:00|        0.001|                          00|
      |1970-01-01T08:00:00.003+08:00|          111|                           1|
      |1970-01-01T08:00:00.004+08:00|   warn:-8721|                          rn|
      |1970-01-01T08:00:00.005+08:00| error:-37229|                          ro|
      |1970-01-01T08:00:00.006+08:00|          100|                           0|
      |1970-01-01T08:00:00.007+08:00|        FALSE|                          LS|
      |1970-01-01T08:00:00.008+08:00|   warn:-8721|                          rn|
      |1970-01-01T08:00:00.009+08:00|        false|                          ls|
      |1970-01-01T08:00:00.010+08:00|         true|                          ue|
      |1970-01-01T08:00:00.011+08:00|     -37229.1|                          72|
      |1970-01-01T08:00:00.012+08:00|        false|                          ls|
      +-----------------------------+-------------+----------------------------+
      Total line number = 12
      It costs 0.019s
      

      Attachments

        Issue Links

          Activity

            People

              caozhijia1 Zhijia Cao
              xiaozhihong xiaozhihong
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: