Correct merge

This commit is contained in:
kssenii 2024-12-03 12:22:22 +01:00
parent f8696aa010
commit eb9d5705a9
4 changed files with 13 additions and 4 deletions

View File

@ -2,6 +2,7 @@
#include <Databases/Iceberg/StorageCredentials.h>
#include <base/find_symbols.h>
#include <Core/Settings.h>
#include <Common/escapeForFileName.h>
#include <Common/threadPoolCallbackRunner.h>
#include <Common/Base64.h>
@ -27,6 +28,11 @@ namespace DB::ErrorCodes
extern const int NOT_IMPLEMENTED;
}
namespace DB::Setting
{
extern const SettingsBool iceberg_engine_ignore_schema_evolution;
}
namespace Iceberg
{
@ -571,8 +577,11 @@ bool RestCatalog::getTableMetadataImpl(
if (result.requiresSchema())
{
const auto & settings = getContext()->getSettingsRef();
int format_version = metadata_object->getValue<int>("format-version");
result.setSchema(DB::IcebergMetadata::parseTableSchema(metadata_object, format_version, true).first);
auto schema = DB::IcebergMetadata::parseTableSchema(
metadata_object, log, format_version, settings[DB::Setting::iceberg_engine_ignore_schema_evolution]).first;
result.setSchema(schema);
}
if (result.requiresCredentials() && object->has("config"))

View File

@ -1077,8 +1077,6 @@ public:
void clearMarkCache() const;
ThreadPool & getLoadMarksThreadpool() const;
ThreadPool & getIcebergCatalogThreadpool() const;
void setPrimaryIndexCache(const String & cache_policy, size_t max_cache_size_in_bytes, double size_ratio);
void updatePrimaryIndexCacheConfiguration(const Poco::Util::AbstractConfiguration & config);
std::shared_ptr<PrimaryIndexCache> getPrimaryIndexCache() const;
@ -1125,6 +1123,7 @@ public:
size_t getPrefetchThreadpoolSize() const;
ThreadPool & getBuildVectorSimilarityIndexThreadPool() const;
ThreadPool & getIcebergCatalogThreadpool() const;
/// Settings for MergeTree background tasks stored in config.xml
BackgroundTaskSchedulingSettings getBackgroundProcessingTaskSchedulingSettings() const;

View File

@ -321,7 +321,7 @@ parseTableSchemaV1Method(const Poco::JSON::Object::Ptr & metadata_object, bool i
return {schema, current_schema_id};
}
std::pair<NamesAndTypesList, Int32> parseTableSchema(
std::pair<NamesAndTypesList, Int32> IcebergMetadata::parseTableSchema(
const Poco::JSON::Object::Ptr & metadata_object, LoggerPtr metadata_logger, int format_version, bool ignore_schema_evolution)
{
Poco::JSON::Object::Ptr schema;

View File

@ -98,6 +98,7 @@ public:
static std::pair<NamesAndTypesList, Int32> parseTableSchema(
const Poco::JSON::Object::Ptr & metadata_object,
LoggerPtr metadata_logger,
int format_version,
bool ignore_schema_evolution);