Skip to content

datafusion_proto::physical_plan_to_bytes has a problem with characterlength function #6387

@milenkovicm

Description

@milenkovicm

Describe the bug

there is issue when physical plan is deserialized from bytes, it looks like the issue is with specific function, length in this case

To Reproduce

reproduction is simple:

use datafusion::prelude::{SessionContext, CsvReadOptions};
use datafusion::error::Result;
use datafusion_proto::bytes::{physical_plan_to_bytes, physical_plan_from_bytes};

let ctx = SessionContext::new();
ctx.register_csv("example", "example.csv", CsvReadOptions::default()).await?;    
let logical_plan = ctx.state().create_logical_plan("select length(c0) as l from example").await?;
let physical_plan = ctx.state().create_physical_plan(&logical_plan).await?;
let blob = physical_plan_to_bytes(physical_plan)?;

// Error: Plan("There is no UDF named \"characterlength\" in the registry")
let _physical_plan = physical_plan_from_bytes(&blob, &ctx)?;

error "There is no UDF named \"characterlength\" in the registry" is raised. Which is odd as length is not an udf.

wondering if characterlength should be character_length?

Expected behavior

other functions work ok, like trim:

let logical_plan = ctx.state().create_logical_plan("select trim(c0) as l from example").await?;
let physical_plan = ctx.state().create_physical_plan(&logical_plan).await?;

let blob = physical_plan_to_bytes(physical_plan)?;
let _physical_plan = physical_plan_from_bytes(&blob, &ctx)?; // All OK

Additional context

tested with datafusion, and datafusion-proto, version 23 and 24

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions