You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iotdb.apache.org by Xiangwei Wei <wx...@gmail.com> on 2020/07/20 03:37:46 UTC

Functional design of quoted paths

Hi all,

Currently, for paths like ROOT.sg.d1."s.1", we support the double quote on
measurement only, and the process about quoted paths is not uniform.

Therefore, in next implementation, we want to achieve the following GOALS:

1. let’s support double quotes on multiple locations of a path (not only
the measurement), like ROOT.sg1."d..1"."s_1". Besides, double quote is used
as quote while single quote is for string literal.

2. let’s uniform the convert between Path and string;

3. maybe we can expose Path object to users in session API.

The next is some EXAMPLES:

Session

String deviceId = "root.sg1.\"d..1\"";List<String> measurements = new
ArrayList<>();measurements.add("\"s..1\"");

JDBC

statement.execute("insert into root.sg1.\"d..1\"(timestamp, \"s..1\")
values(1,2)");
 statement.execute("select * from root");
 headers in result:+-----------------------------+-------------------------------+|

Time|root.turbine1.\"d..1\".\"s..1\"|+-----------------------------+-------------------------------+|1970-01-01T08:00:00.001+08:00|

2.0|+-----------------------------+-------------------------------+

TsFile

We store the following Strings in file:

String devceId = "root.sg1.\"d..1\"";String measurementId = "\"s..1\"";

Schema tree in IoTDB

root -> sg1 -> “d…1” -> “s…1”


Welcome to any suggestions :)


-- 
Best,
Xiangwei Wei

Re: Functional design of quoted paths

Posted by Julian Feinauer <j....@pragmaticminds.de>.
Hey Xiangwei,

that is an excellent suggestion (I discussed the same already with Xiangdong some weeks ago).
We mix a bit between Strings and Paths (and even inside paths we use strings and dynamic parsing too often).

So it would make sense to mee to follow your suggested approach with clear escape rules so that basically every string can be the name of a path / measurement.
This makes especially sense when importing data from external systems.
If you e.g. get device names from another system which allows dots then you cannot map it (bidirectional) to IoTDB.

Best
Julian

Am 20.07.20, 10:41 schrieb "Xiangwei Wei" <wx...@gmail.com>:

    Hi, Xiangdong

    You are right. Thank you for correction.

    Xiangdong Huang <sa...@gmail.com> 于2020年7月20日周一 下午3:29写道:

    > Hi Xiangwei,
    >
    > > Besides, double quote is used as quote while single quote is for string
    > literal.
    >
    > Are you meaning double quote is used as escape character..
    >
    > Best,
    > -----------------------------------
    > Xiangdong Huang
    > School of Software, Tsinghua University
    >
    >  黄向东
    > 清华大学 软件学院
    >
    >
    > Xiangwei Wei <wx...@gmail.com> 于2020年7月20日周一 上午11:38写道:
    >
    > > Hi all,
    > >
    > > Currently, for paths like ROOT.sg.d1."s.1", we support the double quote
    > on
    > > measurement only, and the process about quoted paths is not uniform.
    > >
    > > Therefore, in next implementation, we want to achieve the following
    > GOALS:
    > >
    > > 1. let’s support double quotes on multiple locations of a path (not only
    > > the measurement), like ROOT.sg1."d..1"."s_1". Besides, double quote is
    > used
    > > as quote while single quote is for string literal.
    > >
    > > 2. let’s uniform the convert between Path and string;
    > >
    > > 3. maybe we can expose Path object to users in session API.
    > >
    > > The next is some EXAMPLES:
    > >
    > > Session
    > >
    > > String deviceId = "root.sg1.\"d..1\"";List<String> measurements = new
    > > ArrayList<>();measurements.add("\"s..1\"");
    > >
    > > JDBC
    > >
    > > statement.execute("insert into root.sg1.\"d..1\"(timestamp, \"s..1\")
    > > values(1,2)");
    > >  statement.execute("select * from root");
    > >  headers in
    > > result:+-----------------------------+-------------------------------+|
    > >
    > >
    > >
    > Time|root.turbine1.\"d..1\".\"s..1\"|+-----------------------------+-------------------------------+|1970-01-01T08:00:00.001+08:00|
    > >
    > > 2.0|+-----------------------------+-------------------------------+
    > >
    > > TsFile
    > >
    > > We store the following Strings in file:
    > >
    > > String devceId = "root.sg1.\"d..1\"";String measurementId = "\"s..1\"";
    > >
    > > Schema tree in IoTDB
    > >
    > > root -> sg1 -> “d…1” -> “s…1”
    > >
    > >
    > > Welcome to any suggestions :)
    > >
    > >
    > > --
    > > Best,
    > > Xiangwei Wei
    > >
    >


    -- 
    Best,
    Xiangwei Wei


Re: Functional design of quoted paths

Posted by Xiangwei Wei <wx...@gmail.com>.
Hi, Xiangdong

You are right. Thank you for correction.

Xiangdong Huang <sa...@gmail.com> 于2020年7月20日周一 下午3:29写道:

> Hi Xiangwei,
>
> > Besides, double quote is used as quote while single quote is for string
> literal.
>
> Are you meaning double quote is used as escape character..
>
> Best,
> -----------------------------------
> Xiangdong Huang
> School of Software, Tsinghua University
>
>  黄向东
> 清华大学 软件学院
>
>
> Xiangwei Wei <wx...@gmail.com> 于2020年7月20日周一 上午11:38写道:
>
> > Hi all,
> >
> > Currently, for paths like ROOT.sg.d1."s.1", we support the double quote
> on
> > measurement only, and the process about quoted paths is not uniform.
> >
> > Therefore, in next implementation, we want to achieve the following
> GOALS:
> >
> > 1. let’s support double quotes on multiple locations of a path (not only
> > the measurement), like ROOT.sg1."d..1"."s_1". Besides, double quote is
> used
> > as quote while single quote is for string literal.
> >
> > 2. let’s uniform the convert between Path and string;
> >
> > 3. maybe we can expose Path object to users in session API.
> >
> > The next is some EXAMPLES:
> >
> > Session
> >
> > String deviceId = "root.sg1.\"d..1\"";List<String> measurements = new
> > ArrayList<>();measurements.add("\"s..1\"");
> >
> > JDBC
> >
> > statement.execute("insert into root.sg1.\"d..1\"(timestamp, \"s..1\")
> > values(1,2)");
> >  statement.execute("select * from root");
> >  headers in
> > result:+-----------------------------+-------------------------------+|
> >
> >
> >
> Time|root.turbine1.\"d..1\".\"s..1\"|+-----------------------------+-------------------------------+|1970-01-01T08:00:00.001+08:00|
> >
> > 2.0|+-----------------------------+-------------------------------+
> >
> > TsFile
> >
> > We store the following Strings in file:
> >
> > String devceId = "root.sg1.\"d..1\"";String measurementId = "\"s..1\"";
> >
> > Schema tree in IoTDB
> >
> > root -> sg1 -> “d…1” -> “s…1”
> >
> >
> > Welcome to any suggestions :)
> >
> >
> > --
> > Best,
> > Xiangwei Wei
> >
>


-- 
Best,
Xiangwei Wei

Re: Functional design of quoted paths

Posted by Xiangdong Huang <sa...@gmail.com>.
Hi Xiangwei,

> Besides, double quote is used as quote while single quote is for string
literal.

Are you meaning double quote is used as escape character..

Best,
-----------------------------------
Xiangdong Huang
School of Software, Tsinghua University

 黄向东
清华大学 软件学院


Xiangwei Wei <wx...@gmail.com> 于2020年7月20日周一 上午11:38写道:

> Hi all,
>
> Currently, for paths like ROOT.sg.d1."s.1", we support the double quote on
> measurement only, and the process about quoted paths is not uniform.
>
> Therefore, in next implementation, we want to achieve the following GOALS:
>
> 1. let’s support double quotes on multiple locations of a path (not only
> the measurement), like ROOT.sg1."d..1"."s_1". Besides, double quote is used
> as quote while single quote is for string literal.
>
> 2. let’s uniform the convert between Path and string;
>
> 3. maybe we can expose Path object to users in session API.
>
> The next is some EXAMPLES:
>
> Session
>
> String deviceId = "root.sg1.\"d..1\"";List<String> measurements = new
> ArrayList<>();measurements.add("\"s..1\"");
>
> JDBC
>
> statement.execute("insert into root.sg1.\"d..1\"(timestamp, \"s..1\")
> values(1,2)");
>  statement.execute("select * from root");
>  headers in
> result:+-----------------------------+-------------------------------+|
>
>
> Time|root.turbine1.\"d..1\".\"s..1\"|+-----------------------------+-------------------------------+|1970-01-01T08:00:00.001+08:00|
>
> 2.0|+-----------------------------+-------------------------------+
>
> TsFile
>
> We store the following Strings in file:
>
> String devceId = "root.sg1.\"d..1\"";String measurementId = "\"s..1\"";
>
> Schema tree in IoTDB
>
> root -> sg1 -> “d…1” -> “s…1”
>
>
> Welcome to any suggestions :)
>
>
> --
> Best,
> Xiangwei Wei
>