# Distinct
# 函数简介
本函数可以返回输入序列中出现的所有不同的元素。
函数名: DISTINCT
输入序列: 仅支持单个输入序列,类型可以是任意的
输出序列: 输出单个序列,类型与输入相同。
提示:
- 输出序列的时间戳是无意义的。输出顺序是任意的。
- 缺失值和空值将被忽略,但
NaN
不会被忽略。
# 使用示例
输入序列:
+-----------------------------+---------------+
| Time|root.test.d2.s2|
+-----------------------------+---------------+
|2020-01-01T08:00:00.001+08:00| Hello|
|2020-01-01T08:00:00.002+08:00| hello|
|2020-01-01T08:00:00.003+08:00| Hello|
|2020-01-01T08:00:00.004+08:00| World|
|2020-01-01T08:00:00.005+08:00| World|
+-----------------------------+---------------+
用于查询的SQL语句:
select distinct(s2) from root.test.d2
输出序列:
+-----------------------------+-------------------------+
| Time|distinct(root.test.d2.s2)|
+-----------------------------+-------------------------+
|1970-01-01T08:00:00.001+08:00| Hello|
|1970-01-01T08:00:00.002+08:00| hello|
|1970-01-01T08:00:00.003+08:00| World|
+-----------------------------+-------------------------+