跳转至

SAGE Kernel Examples

This directory contains practical examples demonstrating how to use SAGE Kernel components and APIs.

Example Categories

Basic Usage

简单流处理示例 - Basic streaming operations

环境设置示例 - Setting up local and remote environments

数据处理示例 - Simple data processing pipelines

Advanced Streaming

连接流示例 - Multi-stream processing

窗口操作示例 - Time and count-based windows

复杂事件处理示例 - Pattern detection

Integration Examples

中间件集成示例 - Using with sage-middleware

自定义函数示例 - Custom function development

插件开发示例 - Creating kernel plugins

Real-World Use Cases

日志处理示例 - Log analysis pipeline

IoT数据流示例 - IoT sensor data processing

金融交易示例 - Real-time trading data analysis

Running Examples

Each example can be run independently:

cd packages/sage-kernel
python examples/basic/simple-streaming.py

Or using the sage CLI:

sage run examples/basic/simple-streaming.py

Example Requirements

Some examples may require additional dependencies:

  • pandas for data manipulation examples
  • numpy for numerical computation examples
  • matplotlib for visualization examples

Install with:

pip install intsage-kernel[examples]

Contributing Examples

When adding new examples:

  1. Place them in the appropriate category directory
  2. Include clear documentation and comments
  3. Add any required dependencies to the example header
  4. Update this README with the new example