docs: missing documentation for NUMBERS, NUMBERS_MT, and NUMBERS_LOCAL table functions

Open Beginner friendly
#3,269 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
sql
Domain
documentation

Research direction

Start with the registrations in src/query/service/src/table_functions/table_function_factory.rs and the existing docs/en/sql-reference/00-sql-reference/31-system-tables/system-numbers.md page. Add docs/en/sql-reference/20-sql-functions/17-table-functions/numbers.md covering numbers, numbers_mt, and numbers_local, including syntax, arguments, return schema, parallelism, and examples. Done means all three functions have a dedicated SQL reference page.

Written by the indexing model from the issue text.

Description

automated issue documentation

Summary

The numbers, numbers_mt, and numbers_local table functions are registered in the table function factory but are only documented as a system table (system.numbers), not as table functions in the SQL reference table-functions section.

Source

  • File: /workspace/databend/src/query/service/src/table_functions/table_function_factory.rs
  • Registration (lines 128–142): All three variants are registered via NumbersTable::create
creators.insert("numbers".to_string(), (next_id(), number_table_func_creator.clone()));
creators.insert("numbers_mt".to_string(), (next_id(), number_table_func_creator.clone()));
creators.insert("numbers_local".to_string(), (next_id(), number_table_func_creator));

What They Do

These table functions generate a sequence of integers starting from 0:

  • numbers(N) — Generates N rows with a single UInt64 column number (0 to N-1). Parallelized across all available threads.
  • numbers_mt(N) — Same as numbers, explicitly multi-threaded.
  • numbers_local(N) — Same but runs on a single thread (local execution).

They are widely used for testing, benchmarking, and generating synthetic datasets. Example:

SELECT avg(number) FROM numbers(100000000);
SELECT sum(number) FROM numbers_mt(1000000) WHERE number % 2 = 0;

What's Missing

The existing system.numbers page at /docs/en/sql-reference/00-sql-reference/31-system-tables/system-numbers.md only briefly mentions the function call syntax. There is no dedicated table-function reference page covering all three variants, their differences (parallelism behavior), and usage patterns.

The SHOW TABLE FUNCTIONS output lists numbers, numbers_mt, and numbers_local but users have no reference page to link to.

Suggested Doc Location

/docs/en/sql-reference/20-sql-functions/17-table-functions/numbers.md

The page should cover all three variants, explain the parallelism difference, include the syntax, argument description, return schema, and examples.

Dominant language
TypeScript
Stars
17
Forks
44
Avg merge
2d 7m
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databendlabs/databend-docs

All issues in databendlabs/databend-docs

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.