iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

[To rel/0.13][IOTDB-3450] Support new path pattern: 0 or more layers

Open gouminger opened this issue 2 years ago • 5 comments

Support new path pattern: 0 or more layers

According to the discussion in the mail list, we can get the following syntax:

*(start, end) - start (included) to end (excluded) layers *( , end) - 0 to end (excluded) layers *(start, ) - start (included) or more layers, ** stands for *(1, ) *( , ) - 0 or more layers, maybe we can use a shortcut (such as ***)? *( n ) - exactly n layers, * stands for *(1)

P.S. Currently, '{' and '}' is used in path, to avoid ambiguity, we use '(' and ')' here.

gouminger avatar Aug 23 '22 10:08 gouminger

Please provide some docs and give some sql examples.

MarcosZyk avatar Aug 25 '22 01:08 MarcosZyk

Please add some sql examples to User-Guide doc and add some IT.

MarcosZyk avatar Aug 26 '22 06:08 MarcosZyk

  • *

在路径中表示一层。

root.vehicle.*.sensor1 以root.vehicle为前缀,以sensor1为后缀,层次等于 4 层的路径。

  • **

在路径中表示是(*)+,即为一层或多层*

root.vehicle.device1.** 代表的是root.vehicle.device1.*, root.vehicle.device1.*.*, root.vehicle.device1.*.*.*等所有以root.vehicle.device1为前缀路径的大于等于 4 层的路径。

root.vehicle.**.sensor1 代表的是以root.vehicle为前缀,以sensor1为后缀,层次大于等于 4 层的路径。

  • *(start,end)

在路径中表示最少start层(包含),最多end层(不包含)。

root.vehicle.device1.*(1,4) 代表的是root.vehicle.device1.*, root.vehicle.device1.*.*, root.vehicle.device1.*.*.*层数在4,5,6中的路径;

root.vehicle.*(1,4).sensor1 代表的是以root.vehicle为前缀,以sensor1为后缀,层次在4,5,6中的路径。

  • *(,end)

在路径中表示最少0层(包含),最多end层(不包含)。

root.vehicle.device1.*(,4) 代表的是root.vehicle.device1, root.vehicle.device1.*, root.vehicle.device1.*.*, root.vehicle.device1.*.*.*层数在3,4,5,6中的路径;

root.vehicle.*(,4).sensor1 代表的是以root.vehicle为前缀,以sensor1为后缀,层次在3,4,5,6中的路径。

  • *(start,)

在路径中表示最少start层(包含),最多层数不限制。*(1,)等价于**

root.vehicle.device1.*(2,) 代表的是root.vehicle.device1.*.*, root.vehicle.device1.*.*.*等所有以root.vehicle.device1为前缀路径的大于等于 5 层的路径;

root.vehicle.*(2,).sensor1 代表的是以root.vehicle为前缀,以sensor1为后缀,层次大于等于 5 层的路径。

  • *(,)

在路径中表示最少0层(包含),最多层数不限制;即为0层或0层以上。

root.vehicle.device1.*(,) 代表的是root.vehicle.device1, root.vehicle.device1.*, root.vehicle.device1.*.*, root.vehicle.device1.*.*.*等所有以root.vehicle.device1为前缀路径的大于等于 3 层的路径;

root.vehicle.*(,).sensor1 代表的是以root.vehicle为前缀,以sensor1为后缀,层次大于等于 3 层的路径。

  • *(n)

在路径中表示固定n层。*(1)等价于*

root.vehicle.*(2).sensor1 代表的是以root.vehicle为前缀,以sensor1为后缀,层次等于 5 层的路径。

gouminger avatar Aug 29 '22 03:08 gouminger

please approve running workflows. @MarcosZyk

gouminger avatar Nov 16 '22 01:11 gouminger

please approve this pr @MarcosZyk

gouminger avatar Nov 17 '22 06:11 gouminger