#pragma once #include #include #include #include #include #include namespace DB { class HudiMetadata final : public IDataLakeMetadata, private WithContext { public: using ConfigurationObserverPtr = StorageObjectStorage::ConfigurationObserverPtr; static constexpr auto name = "Hudi"; HudiMetadata(ObjectStoragePtr object_storage_, ConfigurationObserverPtr configuration_, ContextPtr context_); Strings getDataFiles() const override; NamesAndTypesList getTableSchema() const override { return {}; } const DataLakePartitionColumns & getPartitionColumns() const override { return partition_columns; } const std::unordered_map & getColumnNameToPhysicalNameMapping() const override { return column_name_to_physical_name; } bool operator ==(const IDataLakeMetadata & other) const override { const auto * hudi_metadata = dynamic_cast(&other); return hudi_metadata && !data_files.empty() && !hudi_metadata->data_files.empty() && data_files == hudi_metadata->data_files; } static DataLakeMetadataPtr create(ObjectStoragePtr object_storage, ConfigurationObserverPtr configuration, ContextPtr local_context) { return std::make_unique(object_storage, configuration, local_context); } private: const ObjectStoragePtr object_storage; const ConfigurationObserverPtr configuration; mutable Strings data_files; std::unordered_map column_name_to_physical_name; DataLakePartitionColumns partition_columns; Strings getDataFilesImpl() const; }; }