Hi,
We are developping this feature now, we introduce the Null ConstantOperand to 
denote timeseries that do not exist in Where/Having clasuse. 
For example:
select * from root.sg.d1 where s1 > 1 (root.sg.d1.s1 is not existed) 
After analyze, the where predicate will be refactor as : NULL > 1, and the 
final result of this predicate will always be NULL, no rows can be selected 
(only true the row will be selected), this query returns empty block.
 

Additionally, we tidy up the null-related operation rules, refers to MySQL and 
SQL Server

1. Arithmetic:+, -, *, /, %
The resulst will be NULL if any Operand is NULL.
2.Compare: =, >, <, like, in, between...(don't include `is null`)
The resulst will be NULL if any Operand is NULL.
3.Logic: not, and, or
In the following figure, `U` (Undefined) stands for NULL

在 2022-10-09 09:49:58,"Jialin Qiao" <[email protected]> 写道:
>+1, return empty is better than throwing an exception.
>—————————————————
>Jialin Qiao
>Apache IoTDB PMC
>
>冯 庆新 <[email protected]> 于2022年10月8日周六 21:25写道:
>>
>> Hi,
>> I support you in this improvement.
>>
>> 获取 Outlook for iOS<https://aka.ms/o0ukef>
>> ________________________________
>> 发件人: Zhou Yifu <[email protected]>
>> 发送时间: Friday, October 7, 2022 3:48:43 PM
>> 收件人: [email protected] <[email protected]>
>> 主题: 回复: Treat predicate whose time series doesn't exist as false
>>
>> Yes, I agree with you. Query should not return an exception except for a 
>> syntax error.
>>
>> Thanks,
>> Yifu Zhou
>>
>> 从 Windows 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>发送
>>
>> 发件人: Yuan Tian<mailto:[email protected]>
>> 发送时间: 2022年10月7日 14:56
>> 收件人: dev<mailto:[email protected]>
>> 主题: Treat predicate whose time series doesn't exist as false
>>
>> Hi,
>>
>>     Currently in IoTDB, if users write a non-exist time series in
>> select clause, we will simply ignore that and don't display it in
>> result columns instead of throwing exceptions. However, if users write
>> a non-exist time series in where clause, we will throw an exception
>> like: `the path 'root.test.g_0.d1.s2' in WHERE clause does not exist`.
>> It's inconsistent with the select clause, so we prepare to just treat
>> predicate whose time series doesn't exist as false instead of throwing
>> exception, same as InfluxDB.
>>     How do you guys think?
>>     The JIRA is https://issues.apache.org/jira/browse/IOTDB-4576
>>
>>
>> Best,
>> ------------------
>> Yuan Tian
>>

Reply via email to