kamcheungting-db opened a new pull request, #1069: URL: https://github.com/apache/iceberg-cpp/pull/1069
Adds the Iceberg view format v1 metadata model as the first step of view support. This provides types, validation, and lookup helpers for representing view definitions and their history. **Metadata types** - `ViewVersion` records a definition's version ID, schema ID, creation timestamp, summary, representations, optional default catalog, and default namespace. - `ViewRepresentation` is a variant of `SqlViewRepresentation`, which pairs SQL text with its engine dialect, and `UnknownViewRepresentation`, which stores an unrecognized representation's type identifier. `GetSql()` and `RepresentationType()` expose the active representation. - `ViewMetadata` holds the view UUID, format version, location, schemas, current version ID, versions, version log, and properties. `ViewHistoryEntry` records a timestamp and the version made current. - Equality operators compare the metadata, versions, representations, and history entries by value. **Validation and lookups** `ViewMetadata::Validate()` returns `ErrorKind::kInvalid` for the first violated invariant and leaves the metadata unchanged. It checks that: - The view format version is 1, and the UUID and location are non-empty. - Schemas and versions are non-empty lists containing non-null entries with unique IDs. - The current version is listed, and every version references a listed schema. - Every version has a non-empty default namespace. - Each SQL representation has non-empty SQL text and a non-empty dialect, with at most one SQL representation per dialect within a version. Dialect comparison uses ASCII case folding. - Unknown representations have a non-empty type identifier. View schemas are validated independently of table-format schema restrictions, allowing projections to retain the types and nullability of referenced columns. `CurrentVersion()`, `VersionById()`, `CurrentSchema()`, and `SchemaById()` return the matching non-null entry or `ErrorKind::kNotFound` when the requested version or schema is absent. The change also adds `StringUtils::EqualsIgnoreCaseAscii` for dialect matching and registers the new sources, tests, and public headers with the build and C++20 compatibility check. JSON serialization, full preservation of unknown representation payloads, metadata updates, and requirements are follow-up work. **Validation performed** - `view_metadata_test`: all 24 tests pass. Coverage includes valid metadata, multiple versions and dialects, unknown representation types, individual validation failures with asserted error kinds, missing-entry lookups, equality, and representation helpers. - `cpp20_compatibility_test`: passes with the new public headers registered. - `pre-commit run --files <changed files>`: all applicable hooks pass, including trailing whitespace, end-of-file fixes, clang-format, cmake-format, and public-header generation. - The existing build directory's full CTest run completed with 20 of 23 tests passing. `parquet_test` failed because its stale binary references a fixture absent from this branch; `encryption_test` and `scheduled_executor_test` were not run because their binaries were not built. These are separate from the passing view and compatibility tests. -- 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]
