Skip to content

docs: add WORKER documentation for PR #19383#3083

Open
sundy-li wants to merge 11 commits intomainfrom
add-worker-docs
Open

docs: add WORKER documentation for PR #19383#3083
sundy-li wants to merge 11 commits intomainfrom
add-worker-docs

Conversation

@sundy-li
Copy link
Member

Summary

This PR adds comprehensive documentation for the new WORKER feature introduced in databend PR #19383.

Changes

New Documentation

  • Created new directory:
  • Added with overview of WORKER functionality
  • Added with CREATE WORKER syntax and examples
  • Added with SHOW WORKERS syntax and output format
  • Added with ALTER WORKER syntax for SET/UNSET options, tags, and state management
  • Added with DROP WORKER syntax and behavior
  • Added with comprehensive usage examples and best practices

Documentation Updates

  • Updated DDL index page to include WORKER in Resource Management section
  • Updated UDF documentation to reference WORKER management
  • Added for sidebar navigation

Context

The WORKER feature (PR #19383: 'feat: add sandbox env injection case via cloud control') introduces management of UDF execution environments in Databend Cloud sandbox. Each UDF has an associated WORKER that manages its compute resources, providing full lifecycle control.

Key Features Documented

  1. CREATE WORKER - Create execution environment for UDFs
  2. SHOW WORKERS - List all workers with their configurations
  3. ALTER WORKER - Modify settings, tags, and state (SUSPEND/RESUME)
  4. DROP WORKER - Remove worker when no longer needed
  5. Tag Management - Organize workers with key-value tags
  6. Resource Control - Manage size, auto-suspend, auto-resume, cluster counts

Testing

Documentation is based on:

  • Actual code implementation in databend PR #19383
  • Test cases from
  • AST definitions and parser implementations

Related Issues

Closes: # (if applicable)
Related to: databend PR #19383

- Add comprehensive ROWS BETWEEN documentation with examples
- Update window functions index to include window frame section
- Include common patterns: running totals, moving averages, centered windows
- Add best practices and limitations sections

Addresses missing documentation for window frame specification in Databend.
- Add detailed explanation of window frame behavior at partition boundaries
- Include examples showing how windows shrink at edges
- Address common confusion about window size at start/end of partitions
- Add missing RANGE BETWEEN documentation (range-between.md)
- Fix broken cross-reference in rows-between.md
- Update index.md with proper links to both ROWS and RANGE documentation
- Resolve P2 issue: Remove broken RANGE BETWEEN cross-reference by adding the missing file
- Clarify distinction between syntax examples and complete SQL statements
- Add 'Complete example' sections with executable SQL
- Mark syntax examples clearly as patterns (not complete statements)
- Update index.md with validation note
- All complete SQL examples verified with Databend MCP
- Improve documentation clarity and usability
- Use CREATE OR REPLACE TABLE for self-hosted deployments
- Add WITH clause examples for Databend Cloud compatibility
- Ensure all SQL examples can run in restricted environments
- Provide both options with clear explanations
- Maintain result consistency with MCP validation
Add comprehensive documentation for the new WORKER feature introduced in PR #19383:

- Created new directory: docs/en/sql-reference/10-sql-commands/00-ddl/20-worker/
- Added index.md with overview of WORKER functionality
- Added create-worker.md with CREATE WORKER syntax and examples
- Added show-workers.md with SHOW WORKERS syntax and output format
- Added alter-worker.md with ALTER WORKER syntax for SET/UNSET options, tags, and state management
- Added drop-worker.md with DROP WORKER syntax and behavior
- Added examples.md with comprehensive usage examples and best practices
- Updated DDL index page to include WORKER in Resource Management section
- Updated UDF documentation to reference WORKER management
- Added _category_.json for sidebar navigation

The WORKER feature manages UDF execution environments in Databend Cloud sandbox, providing full lifecycle control over compute resources for user-defined functions.
@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 26, 2026 6:38am

Request Review

Resolved conflicts in window function documentation files:
- docs/en/sql-reference/20-sql-functions/08-window-functions/range-between.md
- docs/en/sql-reference/20-sql-functions/08-window-functions/rows-between.md

Conflicts were due to both branches adding the same files. Kept the main branch version of relative links while preserving content.
@chatgpt-codex-connector
Copy link

💡 Codex Review


P1 Badge Terminate SQL code block before Worker Management section

The JavaScript UDF example is not closed before this heading, so the entire “Worker Management for UDFs” content is rendered as part of a SQL code block instead of documentation. That hides headings from navigation/search and turns explanatory links into plain text, which breaks this section for readers.


- [User-Defined Functions](../../../../guides/60-udf/index.md) - Learn about creating and using UDFs
- [Cloud Control](../../../../guides/90-cloud-control/index.md) - Understand cloud integration
- [Resource Management](../../../../guides/80-resource-management/index.md) - Best practices for resource allocation

P2 Badge Point worker related links to existing guide pages

These related-topic links target paths under docs/en/guides that do not exist in the repository (for example guides/60-udf/index.md), so users are sent to 404 pages when following them. Broken navigation in reference docs makes it hard to reach prerequisite material from this page.



P2 Badge Reference a defined table in RANGE BETWEEN complete example

This “Complete example” queries FROM sales, but this page only defines temperature_readings and sales_duplicates, so the query fails when copied as documented. Because the section explicitly labels it complete/executable, this creates a misleading example that cannot run as-is.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

1. Close JavaScript code block in ddl-create-function.md
2. Update broken links in worker examples.md
3. Fix undefined table reference in range-between.md
@KKould
Copy link
Member

KKould commented Feb 27, 2026

This feature is not yet fully supported in Databend Cloud. Please wait for @everpcpc 's update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants