Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: udf looks bad in EXPLAIN #18588

Open
BugenZhao opened this issue Sep 18, 2024 · 0 comments
Open

frontend: udf looks bad in EXPLAIN #18588

BugenZhao opened this issue Sep 18, 2024 · 0 comments
Labels
component/frontend Protocol, parsing, binder. type/enhancement Improvements to existing implementation.
Milestone

Comments

@BugenZhao
Copy link
Member

BugenZhao commented Sep 18, 2024

We directly use the Debug impl of UserDefinedFunction when explaining:

ExprImpl::UserDefinedFunction(x) => write!(f, "{:?}", x),

...which includes the FunctionCatalog, and even the WASM binary as a bytes array!

#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub struct FunctionCatalog {
pub id: FunctionId,
pub name: String,
pub owner: u32,
pub kind: FunctionKind,
pub arg_names: Vec<String>,
pub arg_types: Vec<DataType>,
pub return_type: DataType,
pub language: String,
pub identifier: Option<String>,
pub body: Option<String>,
pub link: Option<String>,
pub compressed_binary: Option<Vec<u8>>,
pub always_retry_on_network_error: bool,
pub function_type: Option<String>,
pub runtime: Option<String>,
}

For example,

create function gcd(int, int) returns int language rust as $$
    fn gcd(mut a: i32, mut b: i32) -> i32 {
        while b != 0 {
            (a, b) = (b, a % b);
        }
        a
    }
$$;

explain select gcd(6, 9);

will leads to an output of 3.6 MB.

@BugenZhao BugenZhao added type/enhancement Improvements to existing implementation. component/frontend Protocol, parsing, binder. labels Sep 18, 2024
@github-actions github-actions bot added this to the release-2.1 milestone Sep 18, 2024
@BugenZhao BugenZhao modified the milestones: release-2.1, release-2.2 Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/frontend Protocol, parsing, binder. type/enhancement Improvements to existing implementation.
Projects
None yet
Development

No branches or pull requests

1 participant