Hi,

it is because when using "*" in your paths (select or from clauses),
the value filter in WHERE clause is "AND" relation.

e.g., you have two devices:
- root.org.logs.ags.ABC.device01
- root.org.logs.ags.DEF.device01

and each device has a measurement "method",

then:
select count(method)
from root.org.logs.ags.*.device01
where method <> 'job'

means:
root.org.logs.ags.ABC.device01.method <> 'job'
AND
root.org.logs.ags.DEF.device01.method <> 'job'

For the issue, current solution is: use ALIGN BY DEVICE

"align by device" does not only display the result in a relational table format,
but also apply the filters in the WHERE clause one device by one device,
i.e., using OR logic:

select count(method)
from root.org.logs.ags.*.device01
where method <> 'job'
align by device

BUT, we hope to solve the semantic misleading in SQLs without "align by device",
the solution may be, change the WHERE clause to:
- where method <> 'job' , for AND logic
- where OR(method <> 'job'), for OR logic

This is just my idea, welcome to give better syntax.

Best,




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

 黄向东
清华大学 软件学院

Trevor Hart <[email protected]> 于2021年9月30日周四 上午4:19写道:
>
> I have this query that works.
>
>
>
> select count(method)
>
> from root.org.logs.ags.ABC.device01
>
> where method <> 'job'
>
> group by ([now()-1W,now()),1H)
>
>
>
> However if I introduce a wildcard all the results are zero. There is no error 
> but all values are zero. Is this expected? If so is there any way to filter 
> across all timeseries?
>
>
> select count(method)
>
> from root.org.logs.ags.*.device01
>
> where method <> 'job'
>
> group by ([now()-1W,now()),1H)
>
>
>
> Thanks
>
> Trevor

Reply via email to