Skip to content

datafusion-proto deserialize with q16 sql fails  #3820

@r4ntix

Description

@r4ntix

Describe the bug
Serialize and Deserialize using q16 in benchmarks failed:

Error: SchemaError(FieldNotFound { qualifier: Some("part"), name: "p_brand", valid_fields: Some(["p_brand", "p_type", "p_size", "COUNT(DISTINCT partsupp.ps_suppkey)"]) })

This problem was found in arrow-ballista's benchmarks test: apache/datafusion-ballista#330

To Reproduce

let plan = ctx
        .sql(
            "
select
    p_brand,
    p_type,
    p_size,
    count(distinct ps_suppkey) as supplier_cnt
from
    partsupp,
    part
where
  p_partkey = ps_partkey
  and p_brand <> 'Brand#45'
  and p_type not like 'MEDIUM POLISHED%'
  and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
  and ps_suppkey not in (
    select
        s_suppkey
    from
        supplier
    where
            s_comment like '%Customer%Complaints%'
)
group by
    p_brand,
    p_type,
    p_size
order by
    supplier_cnt desc,
    p_brand,
    p_type,
    p_size;
    ",
        )
        .await?
        .to_logical_plan()?;
    let bytes = logical_plan_to_bytes(&plan)?;
    let logical_round_trip = logical_plan_from_bytes(&bytes, &ctx)?;
    assert_eq!(format!("{:?}", plan), format!("{:?}", logical_round_trip));

this code logical_plan_from_bytes(&bytes, &ctx)? fails.

Expected behavior

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions