Skip to content

Conversation

@evindj
Copy link
Contributor

@evindj evindj commented Feb 2, 2026

This is the second PR in addressing serde for expression for predicate push down. It focuses on unbound transforms and and named references.
Added unit tests to ensure that serialization happens correctly. while name references will map just names like schema columns, unbound transforms will make sure take care of transform serde. for example it will ensure

{ "type": "transform", "transform": "bucket[16]", "term": "id" }

is converted to an object and vice versa.

@evindj evindj force-pushed the unbound_term_serde branch from 602bef1 to 684d85c Compare February 2, 2026 16:51

Result<std::shared_ptr<NamedReference>> NamedReferenceFromJson(
const nlohmann::json& json) {
if (!json.is_string()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a [[unlikely]] hint?

* under the License.
*/

#include <cctype>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this header?

nlohmann::json ToJson(const UnboundTransform& transform) {
auto& mutable_transform = const_cast<UnboundTransform&>(transform);
nlohmann::json json;
json[kType] = std::string(kTransform);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
json[kType] = std::string(kTransform);
json[kType] = kTransform;

I don't think the string ctor around kTransform is necessary. The same applies to other places as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows does not seem to like it when we don't do the explicit copy.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I'm not entirely sure, but I noticed a similar usage here: https://github.com/apache/iceberg-cpp/blob/main/src/iceberg/json_serde.cc#L1295

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