Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/iceberg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ set(ICEBERG_SOURCES
file_reader.cc
file_writer.cc
inheritable_metadata.cc
json_internal.cc
json_serde.cc
location_provider.cc
manifest/manifest_adapter.cc
manifest/manifest_entry.cc
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/catalog/rest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set(ICEBERG_REST_SOURCES
endpoint.cc
error_handlers.cc
http_client.cc
json_internal.cc
json_serde.cc
resource_paths.cc
rest_catalog.cc
rest_util.cc
Expand Down
4 changes: 2 additions & 2 deletions src/iceberg/catalog/rest/http_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

#include "iceberg/catalog/rest/constant.h"
#include "iceberg/catalog/rest/error_handlers.h"
#include "iceberg/catalog/rest/json_internal.h"
#include "iceberg/catalog/rest/json_serde_internal.h"
#include "iceberg/catalog/rest/rest_util.h"
#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/result.h"
#include "iceberg/util/macros.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@
* under the License.
*/

#include "iceberg/catalog/rest/json_internal.h"

#include <memory>
#include <string>
#include <utility>
#include <vector>

#include <nlohmann/json.hpp>

#include "iceberg/catalog/rest/json_serde_internal.h"
#include "iceberg/catalog/rest/types.h"
#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/partition_spec.h"
#include "iceberg/sort_order.h"
#include "iceberg/table_identifier.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "iceberg/catalog/rest/types.h"
#include "iceberg/result.h"

/// \file iceberg/catalog/rest/json_internal.h
/// \file iceberg/catalog/rest/json_serde_internal.h
/// JSON serialization and deserialization for Iceberg REST Catalog API types.

namespace iceberg::rest {
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/catalog/rest/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ iceberg_rest_sources = files(
'endpoint.cc',
'error_handlers.cc',
'http_client.cc',
'json_internal.cc',
'json_serde.cc',
'resource_paths.cc',
'rest_catalog.cc',
'rest_util.cc',
Expand Down
4 changes: 2 additions & 2 deletions src/iceberg/catalog/rest/rest_catalog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
#include "iceberg/catalog/rest/endpoint.h"
#include "iceberg/catalog/rest/error_handlers.h"
#include "iceberg/catalog/rest/http_client.h"
#include "iceberg/catalog/rest/json_internal.h"
#include "iceberg/catalog/rest/json_serde_internal.h"
#include "iceberg/catalog/rest/resource_paths.h"
#include "iceberg/catalog/rest/rest_catalog.h"
#include "iceberg/catalog/rest/rest_util.h"
#include "iceberg/catalog/rest/types.h"
#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/partition_spec.h"
#include "iceberg/result.h"
#include "iceberg/schema.h"
Expand Down
15 changes: 4 additions & 11 deletions src/iceberg/json_internal.cc → src/iceberg/json_serde.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* under the License.
*/

#include "iceberg/json_internal.h"

#include <algorithm>
#include <cstdint>
#include <format>
Expand All @@ -28,6 +26,7 @@

#include <nlohmann/json.hpp>

#include "iceberg/json_serde_internal.h"
#include "iceberg/name_mapping.h"
#include "iceberg/partition_field.h"
#include "iceberg/partition_spec.h"
Expand Down Expand Up @@ -1397,15 +1396,9 @@ nlohmann::json ToJson(const TableUpdate& update) {
json[kRefName] = u.ref_name();
json[kSnapshotId] = u.snapshot_id();
json[kType] = ToString(u.type());
if (u.min_snapshots_to_keep().has_value()) {
json[kMinSnapshotsToKeep] = u.min_snapshots_to_keep().value();
}
if (u.max_snapshot_age_ms().has_value()) {
json[kMaxSnapshotAgeMs] = u.max_snapshot_age_ms().value();
}
if (u.max_ref_age_ms().has_value()) {
json[kMaxRefAgeMs] = u.max_ref_age_ms().value();
}
SetOptionalField(json, kMinSnapshotsToKeep, u.min_snapshots_to_keep());
SetOptionalField(json, kMaxSnapshotAgeMs, u.max_snapshot_age_ms());
SetOptionalField(json, kMaxRefAgeMs, u.max_ref_age_ms());
break;
}
case TableUpdate::Kind::kSetProperties: {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/iceberg/manifest/v1_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <memory>

#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/manifest/manifest_entry.h"
#include "iceberg/manifest/manifest_list.h"
#include "iceberg/manifest/v1_metadata_internal.h"
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/manifest/v2_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#include "iceberg/constants.h"
#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/manifest/manifest_entry.h"
#include "iceberg/manifest/manifest_list.h"
#include "iceberg/manifest/v2_metadata_internal.h"
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/manifest/v3_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <optional>

#include "iceberg/constants.h"
#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/manifest/manifest_entry.h"
#include "iceberg/manifest/manifest_list.h"
#include "iceberg/manifest/v3_metadata_internal.h"
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ iceberg_sources = files(
'file_reader.cc',
'file_writer.cc',
'inheritable_metadata.cc',
'json_internal.cc',
'json_serde.cc',
'location_provider.cc',
'manifest/manifest_adapter.cc',
'manifest/manifest_entry.cc',
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/table_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "iceberg/constants.h"
#include "iceberg/exception.h"
#include "iceberg/file_io.h"
#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/metrics_config.h"
#include "iceberg/partition_field.h"
#include "iceberg/partition_spec.h"
Expand Down
4 changes: 2 additions & 2 deletions src/iceberg/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ add_iceberg_test(expression_test

add_iceberg_test(json_serde_test
SOURCES
json_internal_test.cc
json_serde_test.cc
metadata_serde_test.cc
schema_json_test.cc)

Expand Down Expand Up @@ -216,7 +216,7 @@ if(ICEBERG_BUILD_REST)
add_rest_iceberg_test(rest_catalog_test
SOURCES
endpoint_test.cc
rest_json_internal_test.cc
rest_json_serde_test.cc
rest_util_test.cc)

if(ICEBERG_BUILD_REST_INTEGRATION_TESTS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
* under the License.
*/

#include "iceberg/json_internal.h"

#include <memory>

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <nlohmann/json.hpp>

#include "iceberg/json_serde_internal.h"
#include "iceberg/name_mapping.h"
#include "iceberg/partition_spec.h"
#include "iceberg/schema.h"
Expand Down
4 changes: 2 additions & 2 deletions src/iceberg/test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ iceberg_tests = {
},
'json_serde_test': {
'sources': files(
'json_internal_test.cc',
'json_serde_test.cc',
'metadata_serde_test.cc',
'schema_json_test.cc',
),
Expand Down Expand Up @@ -103,7 +103,7 @@ iceberg_tests = {
if get_option('rest').enabled()
iceberg_tests += {
'rest_catalog_test': {
'sources': files('rest_json_internal_test.cc', 'rest_util_test.cc'),
'sources': files('rest_json_serde_test.cc', 'rest_util_test.cc'),
'dependencies': [iceberg_rest_dep],
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/test/metadata_io_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "iceberg/arrow/arrow_fs_file_io_internal.h"
#include "iceberg/file_io.h"
#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/partition_spec.h"
#include "iceberg/result.h"
#include "iceberg/schema.h"
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/test/partition_spec_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <gtest/gtest.h>
#include <nlohmann/json.hpp>

#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/partition_field.h"
#include "iceberg/row/partition_values.h"
#include "iceberg/schema.h"
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/test/rest_catalog_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "iceberg/catalog/rest/catalog_properties.h"
#include "iceberg/catalog/rest/error_handlers.h"
#include "iceberg/catalog/rest/http_client.h"
#include "iceberg/catalog/rest/json_internal.h"
#include "iceberg/catalog/rest/json_serde_internal.h"
#include "iceberg/partition_spec.h"
#include "iceberg/result.h"
#include "iceberg/schema.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <gtest/gtest.h>
#include <nlohmann/json.hpp>

#include "iceberg/catalog/rest/json_internal.h"
#include "iceberg/catalog/rest/json_serde_internal.h"
#include "iceberg/catalog/rest/types.h"
#include "iceberg/partition_spec.h"
#include "iceberg/result.h"
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/test/schema_json_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <gtest/gtest.h>
#include <nlohmann/json.hpp>

#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/schema.h"
#include "iceberg/schema_field.h"
#include "iceberg/test/matchers.h"
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/test/test_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include <nlohmann/json.hpp>

#include "iceberg/json_internal.h"
#include "iceberg/json_serde_internal.h"
#include "iceberg/result.h"
#include "iceberg/table_metadata.h"
#include "iceberg/test/test_config.h"
Expand Down
Loading