Skip to content

Roadmap #8

@whki

Description

@whki

Streamsql Roadmap

core

  • SQL syntax parsing
  • Transforming SQL into Stream Computing
  • group by
  • SELECT & WHERE & conditions
  • Group Aggregation
  • Window Aggregation
  • Over Aggregation
  • Execution Plan & Execution Optimization
  • Joins
  • UNION
  • SELECT DISTINCT
  • LIMIT clause
  • HAVING
  • 函数参数支持表达式运算
  • 自定义函数插件
  • 增量计算
  • 函数嵌套
  • 多stream支持
  • 内存管理优化
  • 错误处理和恢复
  • 监控和指标收集
  • 插件系统扩展
  • API文档
  • 示例和教程
  • 基准测试套件

Windows

  • Tumbling Window
  • Sliding Window
  • Counting Window
  • Session Window

聚合函数

  • sum(col)
  • avg(col)
  • min(col)
  • max(col)
  • count(col)
  • stddev(col)
  • median(col)
  • percentile(col)
  • collect: 获取当前窗口所有消息的列 a 的值组成的数组
  • first_value(expr): 返回窗口中第一个值
  • last_value:返回在组中指定列或整个消息中最后一行的值
  • merge_agg:将组中的值合并为单个值
  • stddevs:返回组中所有值的样本标准差。空值不参与计算。
  • deduplicate:返回当前组去重的结果
  • var:返回组中所有值的方差。空值不参与计算。
  • vars:返回组中所有值的样本方差。空值不参与计算。
  • nth_value(expr, n): 返回窗口中第N个值

窗口函数

  • window_start
  • window_end
  • row_number: row_number() 将从 1 开始,为每一条记录返回一个数字。
  • first_value, last_value, lag, lead, nth_value

时间日期函数

  • now
  • current_time
  • current_date

转换函数

  • cast(col, "bigint")
  • encode(col, "base64")
  • decode(col, "base64")
  • hex2dec(col)
  • dec2hex(col)
  • convert_tz(col, "Asia/Shanghai"): 将时间转换为指定时区
  • to_seconds(col): 将日期时间转换为Unix时间戳(秒)
  • chr(col): 返回对应ASCII字符
  • trunc(dec, int): 截断小数位数
  • compress(input, "zlib"): 压缩字符串或二进制值
  • decompress(input, "zlib"): 解压缩字符串或二进制值

数学函数

  • abs(col)
  • acos(col)
  • asin(col)
  • atan(col)
  • atan2(col1, col2)
  • bitand(col1, col2)
  • bitor(col1, col2)
  • bitxor(col1, col2)
  • bitnot(col)
  • ceiling(col)
  • cos(col)
  • cosh(col)
  • exp(col)
  • floor(col)
  • ln(col)
  • power(x, y)
  • sqrt(col)
  • log(col): 计算自然对数
  • log10(col): 计算以10为底的对数
  • log2(col): 计算以2为底的对数
  • mod(col1, col2): 取模运算
  • rand(): 生成随机数
  • round(col, [precision]): 四舍五入
  • sign(col): 返回数字的符号
  • sin(col): 正弦函数
  • sinh(col): 双曲正弦函数
  • tan(col): 正切函数
  • tanh(col): 双曲正切函数

字符串函数

  • concat(col1...)
  • length(col)
  • lower(col)
  • upper(col)
  • trim(col)
  • format(col,D[,locale])
  • endswith(col, suffix): 检查字符串是否以指定后缀结尾
  • startswith(col, prefix): 检查字符串是否以指定前缀开始
  • indexof(col, substr): 返回子字符串在字符串中的位置
  • substring(col, start, [length]): 提取子字符串
  • replace(col, old, new): 替换字符串中的内容
  • split(col, delimiter): 按分隔符分割字符串
  • lpad(col, length, [pad]): 左填充字符串
  • rpad(col, length, [pad]): 右填充字符串
  • ltrim(col): 去除左侧空白字符
  • rtrim(col): 去除右侧空白字符
  • regexp_matches(col, pattern): 正则表达式匹配
  • regexp_replace(col, pattern, replacement): 正则表达式替换
  • regexp_substring(col, pattern): 正则表达式提取子字符串

JSON函数

  • to_json(col): 转换为JSON字符串
  • from_json(col): 从JSON字符串解析
  • json_extract(col, path): 提取JSON字段值
  • json_valid(col): 验证JSON格式是否有效
  • json_type(col): 返回JSON值的类型
  • json_length(col): 返回JSON数组或对象的长度

哈希函数

  • md5(col): 计算MD5哈希值
  • sha1(col): 计算SHA1哈希值
  • sha256(col): 计算SHA256哈希值
  • sha512(col): 计算SHA512哈希值

数组函数

  • array_length(col): 返回数组长度
  • array_contains(array, value): 检查数组是否包含指定值
  • array_position(array, value): 返回值在数组中的位置
  • array_remove(array, value): 从数组中移除指定值
  • array_distinct(array): 数组去重
  • array_intersect(array1, array2): 数组交集
  • array_union(array1, array2): 数组并集
  • array_except(array1, array2): 数组差集

多行函数

  • unnest(array): 将数组展开为多行,如果数组元素为对象则展开为列

多列函数

  • changed_cols(prefix, ignoreNull, colA, colB): 返回值有变化的列,列名添加指定前缀

类型检查函数

  • is_null(col): 检查是否为NULL
  • is_not_null(col): 检查是否不为NULL
  • is_numeric(col): 检查是否为数字类型
  • is_string(col): 检查是否为字符串类型
  • is_bool(col): 检查是否为布尔类型
  • is_array(col): 检查是否为数组类型
  • is_object(col): 检查是否为对象类型

条件函数

  • coalesce(col1, col2, ...): 返回第一个非NULL值
  • nullif(col1, col2): 如果两个值相等则返回NULL
  • greatest(col1, col2, ...): 返回最大值
  • least(col1, col2, ...): 返回最小值
  • case_when(condition, value, ...): CASE WHEN表达式

时间日期函数扩展

  • date_add(date, interval, unit): 日期加法
  • date_sub(date, interval, unit): 日期减法
  • date_diff(date1, date2, unit): 计算日期差
  • date_format(date, format): 格式化日期
  • date_parse(str, format): 解析日期字符串
  • extract(unit, date): 提取日期部分
  • unix_timestamp(date): 转换为Unix时间戳
  • from_unixtime(timestamp): 从Unix时间戳转换
  • year(date): 提取年份
  • month(date): 提取月份
  • day(date): 提取日期
  • hour(date): 提取小时
  • minute(date): 提取分钟
  • second(date): 提取秒数
  • dayofweek(date): 获取星期几
  • dayofyear(date): 获取一年中的第几天
  • weekofyear(date): 获取一年中的第几周

转换函数扩展

  • url_encode(col): URL编码
  • url_decode(col): URL解码

分析函数

  • lag(expr, [offset], [default value], [ignore null])
  • latest
  • changed_col:返回列的相比上次执行后的变化值。若未变化则返回 null 。
  • had_changed:返回是否上次运行后列的值有变化

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions