# Streamsql Roadmap ## core - [x] SQL syntax parsing - [x] Transforming SQL into Stream Computing - [x] group by - [x] SELECT & WHERE & conditions - [x] Group Aggregation - [x] Window Aggregation - [ ] Over Aggregation - [ ] Execution Plan & Execution Optimization - [ ] Joins - [ ] UNION - [x] SELECT DISTINCT - [x] LIMIT clause - [x] HAVING - [x] 函数参数支持表达式运算 - [x] 自定义函数插件 - [x] 增量计算 - [x] 函数嵌套 - [ ] 多stream支持 - [x] 内存管理优化 - [x] 错误处理和恢复 - [x] 监控和指标收集 - [ ] 插件系统扩展 - [x] API文档 - [ ] 示例和教程 - [x] 基准测试套件 ## Windows - [x] Tumbling Window - [x] Sliding Window - [x] Counting Window - [x] Session Window ## 聚合函数 - [x] sum(col) - [x] avg(col) - [x] min(col) - [x] max(col) - [x] count(col) - [x] stddev(col) - [x] median(col) - [x] percentile(col) - [x] collect: 获取当前窗口所有消息的列 a 的值组成的数组 - [x] first_value(expr): 返回窗口中第一个值 - [x] last_value:返回在组中指定列或整个消息中最后一行的值 - [x] merge_agg:将组中的值合并为单个值 - [x] stddevs:返回组中所有值的样本标准差。空值不参与计算。 - [x] deduplicate:返回当前组去重的结果 - [x] var:返回组中所有值的方差。空值不参与计算。 - [x] vars:返回组中所有值的样本方差。空值不参与计算。 - [x] nth_value(expr, n): 返回窗口中第N个值 ## 窗口函数 - [x] window_start - [x] window_end - [x] row_number: row_number() 将从 1 开始,为每一条记录返回一个数字。 - [x] first_value, last_value, lag, lead, nth_value ## 时间日期函数 - [x] now - [x] current_time - [x] current_date ## 转换函数 - [x] cast(col, "bigint") - [x] encode(col, "base64") - [x] decode(col, "base64") - [x] hex2dec(col) - [x] dec2hex(col) - [x] convert_tz(col, "Asia/Shanghai"): 将时间转换为指定时区 - [x] to_seconds(col): 将日期时间转换为Unix时间戳(秒) - [x] chr(col): 返回对应ASCII字符 - [x] trunc(dec, int): 截断小数位数 - [x] compress(input, "zlib"): 压缩字符串或二进制值 - [x] decompress(input, "zlib"): 解压缩字符串或二进制值 ## 数学函数 - [x] abs(col) - [x] acos(col) - [x] asin(col) - [x] atan(col) - [x] atan2(col1, col2) - [x] bitand(col1, col2) - [x] bitor(col1, col2) - [x] bitxor(col1, col2) - [x] bitnot(col) - [x] ceiling(col) - [x] cos(col) - [x] cosh(col) - [x] exp(col) - [x] floor(col) - [x] ln(col) - [x] power(x, y) - [x] sqrt(col) - [x] log(col): 计算自然对数 - [x] log10(col): 计算以10为底的对数 - [x] log2(col): 计算以2为底的对数 - [x] mod(col1, col2): 取模运算 - [x] rand(): 生成随机数 - [x] round(col, [precision]): 四舍五入 - [x] sign(col): 返回数字的符号 - [x] sin(col): 正弦函数 - [x] sinh(col): 双曲正弦函数 - [x] tan(col): 正切函数 - [x] tanh(col): 双曲正切函数 ## 字符串函数 - [x] concat(col1...) - [x] length(col) - [x] lower(col) - [x] upper(col) - [x] trim(col) - [x] format(col,D[,locale]) - [x] endswith(col, suffix): 检查字符串是否以指定后缀结尾 - [x] startswith(col, prefix): 检查字符串是否以指定前缀开始 - [x] indexof(col, substr): 返回子字符串在字符串中的位置 - [x] substring(col, start, [length]): 提取子字符串 - [x] replace(col, old, new): 替换字符串中的内容 - [x] split(col, delimiter): 按分隔符分割字符串 - [x] lpad(col, length, [pad]): 左填充字符串 - [x] rpad(col, length, [pad]): 右填充字符串 - [x] ltrim(col): 去除左侧空白字符 - [x] rtrim(col): 去除右侧空白字符 - [x] regexp_matches(col, pattern): 正则表达式匹配 - [x] regexp_replace(col, pattern, replacement): 正则表达式替换 - [x] regexp_substring(col, pattern): 正则表达式提取子字符串 ## JSON函数 - [x] to_json(col): 转换为JSON字符串 - [x] from_json(col): 从JSON字符串解析 - [x] json_extract(col, path): 提取JSON字段值 - [x] json_valid(col): 验证JSON格式是否有效 - [x] json_type(col): 返回JSON值的类型 - [x] json_length(col): 返回JSON数组或对象的长度 ## 哈希函数 - [x] md5(col): 计算MD5哈希值 - [x] sha1(col): 计算SHA1哈希值 - [x] sha256(col): 计算SHA256哈希值 - [x] sha512(col): 计算SHA512哈希值 ## 数组函数 - [x] array_length(col): 返回数组长度 - [x] array_contains(array, value): 检查数组是否包含指定值 - [x] array_position(array, value): 返回值在数组中的位置 - [x] array_remove(array, value): 从数组中移除指定值 - [x] array_distinct(array): 数组去重 - [x] array_intersect(array1, array2): 数组交集 - [x] array_union(array1, array2): 数组并集 - [x] array_except(array1, array2): 数组差集 ## 多行函数 - [x] unnest(array): 将数组展开为多行,如果数组元素为对象则展开为列 ## 多列函数 - [x] changed_cols(prefix, ignoreNull, colA, colB): 返回值有变化的列,列名添加指定前缀 ## 类型检查函数 - [x] is_null(col): 检查是否为NULL - [x] is_not_null(col): 检查是否不为NULL - [x] is_numeric(col): 检查是否为数字类型 - [x] is_string(col): 检查是否为字符串类型 - [x] is_bool(col): 检查是否为布尔类型 - [x] is_array(col): 检查是否为数组类型 - [x] is_object(col): 检查是否为对象类型 ## 条件函数 - [x] coalesce(col1, col2, ...): 返回第一个非NULL值 - [x] nullif(col1, col2): 如果两个值相等则返回NULL - [x] greatest(col1, col2, ...): 返回最大值 - [x] least(col1, col2, ...): 返回最小值 - [x] case_when(condition, value, ...): CASE WHEN表达式 ## 时间日期函数扩展 - [x] date_add(date, interval, unit): 日期加法 - [x] date_sub(date, interval, unit): 日期减法 - [x] date_diff(date1, date2, unit): 计算日期差 - [x] date_format(date, format): 格式化日期 - [x] date_parse(str, format): 解析日期字符串 - [x] extract(unit, date): 提取日期部分 - [x] unix_timestamp(date): 转换为Unix时间戳 - [x] from_unixtime(timestamp): 从Unix时间戳转换 - [x] year(date): 提取年份 - [x] month(date): 提取月份 - [x] day(date): 提取日期 - [x] hour(date): 提取小时 - [x] minute(date): 提取分钟 - [x] second(date): 提取秒数 - [x] dayofweek(date): 获取星期几 - [x] dayofyear(date): 获取一年中的第几天 - [x] weekofyear(date): 获取一年中的第几周 ## 转换函数扩展 - [ ] url_encode(col): URL编码 - [ ] url_decode(col): URL解码 ## 分析函数 - [x] lag(expr, [offset], [default value], [ignore null]) - [x] latest - [x] changed_col:返回列的相比上次执行后的变化值。若未变化则返回 null 。 - [x] had_changed:返回是否上次运行后列的值有变化
Streamsql Roadmap
core
Windows
聚合函数
窗口函数
时间日期函数
转换函数
数学函数
字符串函数
JSON函数
哈希函数
数组函数
多行函数
多列函数
类型检查函数
条件函数
时间日期函数扩展
转换函数扩展
分析函数