Skip to content

Conversation

@AdamGS
Copy link

@AdamGS AdamGS commented Oct 7, 2025

Using the newly released serde_core seems to have significant benefit for compile times, pbjson is the main user left in Datafusion.

This is a breaking change, as it generates different code (serde_core:: instead of serde::), and also significantly moves up the required serde/serde_core versions.

There is one #[derive(Deserialize)] which I couldn't figure out yet, but I figured its worth opening this PR for early feedback.

@AdamGS
Copy link
Author

AdamGS commented Oct 14, 2025

Seems like reproducing the auto-generated code requires something like serde-content, would that be an acceptable addition here?

@crepererum
Copy link
Contributor

Seems like reproducing the auto-generated code requires something like serde-content, would that be an acceptable addition here?

Can you elaborate why this is required? I'm failing to see the reason for that 😅

@crepererum
Copy link
Contributor

OK, I did look into this more in depth: the issue is pbjson::private::Content and the borrowing deserialization that comes with it. If you cargo-expand the derived implementation, you end up with a lot of private serde APIs used. So we would either implement the glue code ourselves (a few hundred lines) or use -- as @AdamGS suggested -- serde-content. It's a bit of a shame that the serde_core crates are basically unusable without helpers for more complex settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants