#pragma once #include "config.h" #if USE_PARQUET #include #include #include #include #include namespace DB { class DeltaLakeMetadata final : public IDataLakeMetadata { public: using ConfigurationObserverPtr = StorageObjectStorage::ConfigurationObserverPtr; static constexpr auto name = "DeltaLake"; DeltaLakeMetadata(ObjectStoragePtr object_storage_, ConfigurationObserverPtr configuration_, ContextPtr context_); Strings getDataFiles() const override { return data_files; } NamesAndTypesList getTableSchema() const override { return schema; } 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 * deltalake_metadata = dynamic_cast(&other); return deltalake_metadata && !data_files.empty() && !deltalake_metadata->data_files.empty() && data_files == deltalake_metadata->data_files; } static DataLakeMetadataPtr create(ObjectStoragePtr object_storage, ConfigurationObserverPtr configuration, ContextPtr local_context) { return std::make_unique(object_storage, configuration, local_context); } private: mutable Strings data_files; NamesAndTypesList schema; std::unordered_map column_name_to_physical_name; DataLakePartitionColumns partition_columns; }; } #endif