evindj commented on code in PR #553:
URL: https://github.com/apache/iceberg-cpp/pull/553#discussion_r2853248102
##########
src/iceberg/expression/json_serde.cc:
##########
@@ -58,6 +69,53 @@ constexpr std::string_view kTypeCountNull = "count-null";
constexpr std::string_view kTypeCountStar = "count-star";
constexpr std::string_view kTypeMin = "min";
constexpr std::string_view kTypeMax = "max";
+constexpr std::string_view kTypeLiteral = "literal";
+constexpr std::string_view kTypeReference = "reference";
+
+/// Helper to check if a JSON term represents a transform
+bool IsTransformTerm(const nlohmann::json& json) {
+ return json.is_object() && json.contains(kType) &&
+ json[kType].get<std::string>() == kTransform && json.contains(kTerm);
Review Comment:
``` json.contains(kType)`` ensures that kType exists
##########
src/iceberg/expression/json_serde.cc:
##########
@@ -58,6 +69,53 @@ constexpr std::string_view kTypeCountNull = "count-null";
constexpr std::string_view kTypeCountStar = "count-star";
constexpr std::string_view kTypeMin = "min";
constexpr std::string_view kTypeMax = "max";
+constexpr std::string_view kTypeLiteral = "literal";
+constexpr std::string_view kTypeReference = "reference";
+
+/// Helper to check if a JSON term represents a transform
+bool IsTransformTerm(const nlohmann::json& json) {
+ return json.is_object() && json.contains(kType) &&
+ json[kType].get<std::string>() == kTransform && json.contains(kTerm);
Review Comment:
``` json.contains(kType)``` ensures that kType exists
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]