You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iotdb.apache.org by 陈振宇 <ch...@tsinghua-eiri.org> on 2022/06/04 08:25:40 UTC

IoTDB schema to relational schema discussion

I know the community has discussed several times about how to let IoTDB support standard SQL [1]. A naive perspective is that if we can convert IoTDB into a relational table schema, then we can use the ability of standard SQL to represent richful query semantics. 
The current idea is to take reference in Apache Druid, which allows users define which column represents for the timestamp, which columns are dimensions (equals to iotdb's time series path, except for the last level of the path), and which are metrics (equals to iotdb's measurement)[2].
If there is such an interface to let users define the above info (Druid uses a json to define that), then it is possible to transform the schema of IoTDB into a relational model. This would further optimize the Apache Calcite integration work previously attempt by the community, and enrich the query capacity of IoTDB.
[1] https://lists.apache.org/thread/gwrm4rly3jsz7zyxm8bwhr1yy4g13x65
[2] https://druid.apache.org/docs/0.22.1/ingestion/schema-design.html#time-series-model

Re: IoTDB schema to relational schema discussion

Posted by Eric Pai <er...@hotmail.com>.
Wow, I think this is very interesting to link relational model to our timeseries model.
Could you give some examples about how to map timeseries to tables and columns? In my brief study about Druid, it seems that for a particular measurement of thousands of devices, it may be a wild table with amount of columns?

在 2022/6/4 16:25,“陈振宇”<ch...@tsinghua-eiri.org> 写入:

    I know the community has discussed several times about how to let IoTDB support standard SQL [1]. A naive perspective is that if we can convert IoTDB into a relational table schema, then we can use the ability of standard SQL to represent richful query semantics. 
    The current idea is to take reference in Apache Druid, which allows users define which column represents for the timestamp, which columns are dimensions (equals to iotdb's time series path, except for the last level of the path), and which are metrics (equals to iotdb's measurement)[2].
    If there is such an interface to let users define the above info (Druid uses a json to define that), then it is possible to transform the schema of IoTDB into a relational model. This would further optimize the Apache Calcite integration work previously attempt by the community, and enrich the query capacity of IoTDB.
    [1] https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.apache.org%2Fthread%2Fgwrm4rly3jsz7zyxm8bwhr1yy4g13x65&amp;data=05%7C01%7C%7Cdc83a45018b34784cbeb08da4603d631%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637899279555596385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Qa361I1PeFQOC%2F2mxI6BTGUSeAkBrRb2krgZsahTViw%3D&amp;reserved=0
    [2] https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdruid.apache.org%2Fdocs%2F0.22.1%2Fingestion%2Fschema-design.html%23time-series-model&amp;data=05%7C01%7C%7Cdc83a45018b34784cbeb08da4603d631%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637899279555596385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=DZDQPZUliOnsMwCzrOD%2Fq9p%2FKFHPR3Z1GC7rys7eyi8%3D&amp;reserved=0