Skip to content

Add DataFrame::with_column #2844

@andygrove

Description

@andygrove

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Someone is asking about this feature on StackOverflow: https://stackoverflow.com/questions/72876397/impute-and-add-new-calculated-column-with-rust-datafusion

Describe the solution you'd like
Add with_column(&self, name: &str, expr: Expr). This should add the new column to the data frame.

Example:

let df = df.with_column("sales_tax", col("price").mult(lit(0.04)));

Describe alternatives you've considered
None

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions