Skip to content

Dataframe: select wildcard not working #15218

Closed
@jayzhan211

Description

@jayzhan211

Describe the bug

#[tokio::test]
async fn select_all() -> Result<()> {
    // build plan using `select_expr``
    let t = test_table().await?;

    let df = t
    .select(vec![wildcard()])?;

    let plan = df
        .logical_plan().clone();
    
    let r = df.collect().await?;
    println!("r: {:?}", r);


    println!("paln: {}", plan.display_indent());

    Ok(())
}

This query is no longer working after https://github.com/apache/datafusion/pull/15170/files. I didn't notice Dataframe case but only sql case.

But given Expr::Wildcard is deprecated, we need to find alternative way to support wildcard.

One way is to add WildcardOptions

impl Projection {
    pub fn try_new_with_schema(
        expr: Vec<Expr>,
        wildcard: Option<WildcardOptions>,
        input: Arc<LogicalPlan>,
        schema: DFSchemaRef,
    ) -> Result<Self>

or maybe a new Enum

enum ProjectionExprs {
    /// The expressions are provided as a list of expressions
    Exprs(Vec<Expr>),
    /// The expressions are provided as a wildcard
    Wildcard(WildcardOptions),
}

However, both require API change

Also, I would like to add new API like select_all or project_all for wildcard cases

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingregressionSomething that used to work no longer does

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions