apache / apache/datafusion

Support setseed function

Open
#12,776 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

support select setseed(xxx);

Here is defination in pg. https://www.postgresql.org/docs/current/functions-math.html
```
setseed ( double precision ) → void

Sets the seed for subsequent random() and random_normal() calls; argument must be between -1.0 and 1.0, inclusive

setseed(0.12345)
```

It will be helpful to create random but unchanging test data.

### Describe the solution you'd like

_No response_

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by examining DataFusion's existing support for random() and related SQL functions, then compare the requested behavior with PostgreSQL's setseed definition in the linked documentation. Identify the relevant SQL function tests or entry points and verify that setseed accepts the documented range and controls subsequent random() calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, rust, sql
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.