Skip to content

support seed for random function #17686

@chenkovsky

Description

@chenkovsky

Is your feature request related to a problem or challenge?

for example,
in https://github.com/lakehq/sail/blob/main/crates/sail-plan/src/extension/function/math/randn.rs

it seems that every record batch will have same init seed and same random result.

Describe the solution you'd like

add partition & record_batch_index into evalutate method arguments.

e.g.

pub trait PhysicalExpr {
  fn evaluate(&self, batch: &RecordBatch, partiton: usize, record_batch_index: usize) -> Result<ColumnarValue>;
}

then we get different seed for different record batch.

in spark, seeds are different for different partitions.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions