RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

  • StreamSQL

    • Overview
    • Quick Start
    • Core Concepts
    • SQL Reference
    • API Reference
    • RuleGo Integration
    • functions

      • Aggregate Functions
      • Analytical Functions
      • Window Functions
      • Math Functions
      • String Functions
      • Conversion Functions
      • DateTime Functions
      • JSON Functions
      • Hash Functions
      • Array Functions
      • Type Check Functions
      • Conditional Functions
      • Multi-row Functions
        • UNNEST - Unnest Function
        • 📚 Related Documentation
      • Expression Functions
      • Custom Functions
    • case-studies

目录

Multi-row Functions

# StreamSQL Multi-row Functions

Multi-row functions are used for handling multi-row data.

# UNNEST - Unnest Function

Syntax: unnest(array)
Description: Expands an array into multiple rows.
Incremental Calculation: Not Supported

Example 1 - Expand Simple Array:

SELECT unnest(tags) as tag FROM events
1

Input Data:

{
  "id": 1,
  "tags": ["a", "b", "c"]
}
1
2
3
4

Output Result:

{"tag": "a"}
{"tag": "b"}
{"tag": "c"}
1
2
3

Example 2 - Expand Object Array:

SELECT unnest(items) FROM orders
1

Input Data:

{
  "order_id": "O001",
  "items": [
    {"product": "apple", "price": 1.5},
    {"product": "banana", "price": 0.8}
  ]
}
1
2
3
4
5
6
7

Output Result:

{"product": "apple", "price": 1.5}
{"product": "banana", "price": 0.8}
1
2

# 📚 Related Documentation

  • Conditional Functions - Learn detailed usage of conditional functions
  • Expression Functions - Learn detailed usage of expression functions
  • SQL Reference - View complete SQL syntax reference
Edit this page on GitHub (opens new window)
Last Updated: 2025/09/08, 10:41:28
Conditional Functions
Expression Functions

← Conditional Functions Expression Functions→

Theme by Vdoing | Copyright © 2023-2025 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式