Skip to content

Conversation

@wizardxz
Copy link

No description provided.

@findepi
Copy link

findepi commented Jun 24, 2025

Is this a cherry pick from upstream?

@wizardxz
Copy link
Author

Is this a cherry pick from upstream?

I wrote this, I need this diff to differentiate databricks explode(not expanding struct) and inline(expanding struct)

@findepi
Copy link

findepi commented Jun 24, 2025

Is this upstreamable?

We should avoid any permanent changes on the fork. If this is not upstreamable, let's find an alternative approach. For example, can this be modeled as a UDF call or UDF + unnest?

For example, of unnest always expands a struct, modeling non-expanding struct could be as easy as wrapping the data in another layer of struct before calling unnest.

@wizardxz
Copy link
Author

Is this upstreamable?
yes

We should avoid any permanent changes on the fork.
Totally agree, this PR is just a demo for @vgapeyev

can this be modeled as a UDF call or UDF + unnest?
Yes
I cloned a lot of code from datafusion for post-processing Expr::Unnest
https://github.com/dbt-labs/fs/blob/zhong/databricks_table_functions/crates/sdf-frontend/src/sql/common.rs#L3167
If we want to model unnest as UDF, then we need to post-processing UDF
The good thing is if we model as UDF, we can add as many metadata(e.g. inline_struct_fields) as we want
But I still prefer upstreaming this PR, I think datafusion eventually need this.

@github-actions
Copy link

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 24, 2025
@github-actions github-actions bot closed this Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants