zhjwpku commented on code in PR #534:
URL: https://github.com/apache/iceberg-cpp/pull/534#discussion_r2726191077
##########
src/iceberg/CMakeLists.txt:
##########
@@ -31,6 +31,7 @@ set(ICEBERG_SOURCES
expression/expression.cc
expression/expressions.cc
expression/inclusive_metrics_evaluator.cc
+ expression/json_internal.cc
Review Comment:
By convention, this file should be named json.cc, as `internal` is typically
reserved for header files. I'm aware that we already have a `json_internal.cc`,
but that’s legacy. I think `json_serde.cc/ json_serde_internal.h` would be a
better choice. What do you think, @wgtmac?
##########
src/iceberg/test/expression_json_test.cc:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <memory>
+#include <vector>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <nlohmann/json.hpp>
+
+#include "iceberg/expression/expression.h"
+#include "iceberg/expression/expressions.h"
+#include "iceberg/expression/json_internal.h"
+#include "iceberg/expression/literal.h"
+#include "iceberg/expression/predicate.h"
+#include "iceberg/expression/term.h"
+#include "iceberg/test/matchers.h"
+
+namespace iceberg {
+
+class ExpressionJsonTest : public ::testing::Test {
+ protected:
+ // Helper to test round-trip serialization
+ // Uses string comparison since expressions may have different internal
identity
+ // but the same semantic meaning (i.e., ToString() output matches)
+ void TestRoundTrip(const Expression& expr) {
Review Comment:
You add this helper function but not used anywhere.
--
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]