|
33 | 33 | #include "paimon/common/utils/string_utils.h" |
34 | 34 | #include "paimon/common/utils/path_util.h" |
35 | 35 | #include "paimon/core/core_options.h" |
| 36 | +#include "paimon/defs.h" |
36 | 37 | #include "paimon/core/schema/schema_manager.h" |
37 | 38 | #include "paimon/core/schema/table_schema.h" |
38 | 39 | #include "paimon/core/snapshot.h" |
@@ -253,11 +254,12 @@ Result<std::vector<GenericRow>> TablesSystemTable::BuildRows() const { |
253 | 254 | continue; |
254 | 255 | } |
255 | 256 |
|
256 | | - // Determine table type |
| 257 | + // Determine table type: EXTERNAL if data-file.external-paths is set |
257 | 258 | std::string table_type_str = "MANAGED"; |
258 | | - // Check if table has external path in options |
259 | | - const auto& options = data_schema->Options(); |
260 | | - // (simplified: could check for external path options) |
| 259 | + const auto& opts = data_schema->Options(); |
| 260 | + if (opts.find(Options::DATA_FILE_EXTERNAL_PATHS) != opts.end()) { |
| 261 | + table_type_str = "EXTERNAL"; |
| 262 | + } |
261 | 263 |
|
262 | 264 | bool partitioned = !data_schema->PartitionKeys().empty(); |
263 | 265 | std::string primary_keys_str; |
@@ -287,8 +289,10 @@ Result<std::vector<GenericRow>> TablesSystemTable::BuildRows() const { |
287 | 289 | auto total_count = snapshot.TotalRecordCount(); |
288 | 290 | row.SetField(5, total_count ? VariantType(total_count.value()) |
289 | 291 | : VariantType(NullType())); |
290 | | - // file_size and file_count not available from Snapshot alone; |
291 | | - // leave as null for now |
| 292 | + // TODO(suxiaogang223): Populate file_size_in_bytes, file_count, and |
| 293 | + // last_file_creation_time by reading manifest entries. This requires |
| 294 | + // the manifest reading infrastructure from the files/manifests system |
| 295 | + // tables PR (codex/system-table-files-manifests-pr4). |
292 | 296 | row.SetField(6, NullType()); |
293 | 297 | row.SetField(7, NullType()); |
294 | 298 | row.SetField(8, NullType()); |
|
0 commit comments