mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 09:52:38 +00:00
Merge pull request #72185 from yariks5s/fix_bugs_storageobjectstorage
Small bugs fixes in `StorageObjectStorage`
This commit is contained in:
commit
d93dff37f3
@ -42,7 +42,7 @@ namespace ErrorCodes
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
String StorageObjectStorage::getPathSample(StorageInMemoryMetadata metadata, ContextPtr context)
|
||||
String StorageObjectStorage::getPathSample(ContextPtr context)
|
||||
{
|
||||
auto query_settings = configuration->getQuerySettings(context);
|
||||
/// We don't want to throw an exception if there are no files with specified path.
|
||||
@ -60,7 +60,7 @@ String StorageObjectStorage::getPathSample(StorageInMemoryMetadata metadata, Con
|
||||
local_distributed_processing,
|
||||
context,
|
||||
{}, // predicate
|
||||
metadata.getColumns().getAll(), // virtual_columns
|
||||
{}, // virtual_columns
|
||||
nullptr, // read_keys
|
||||
{} // file_progress_callback
|
||||
);
|
||||
@ -121,7 +121,7 @@ StorageObjectStorage::StorageObjectStorage(
|
||||
metadata.setComment(comment);
|
||||
|
||||
if (sample_path.empty() && context->getSettingsRef()[Setting::use_hive_partitioning])
|
||||
sample_path = getPathSample(metadata, context);
|
||||
sample_path = getPathSample(context);
|
||||
|
||||
setVirtuals(VirtualColumnUtils::getVirtualsForFileLikeStorage(metadata.columns, context, sample_path, format_settings));
|
||||
setInMemoryMetadata(metadata);
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
const ContextPtr & context);
|
||||
|
||||
protected:
|
||||
String getPathSample(StorageInMemoryMetadata metadata, ContextPtr context);
|
||||
String getPathSample(ContextPtr context);
|
||||
|
||||
static std::unique_ptr<ReadBufferIterator> createReadBufferIterator(
|
||||
const ObjectStoragePtr & object_storage,
|
||||
|
@ -757,6 +757,7 @@ StorageObjectStorage::ObjectInfoPtr StorageObjectStorageSource::KeysIterator::ne
|
||||
auto metadata = object_storage->tryGetObjectMetadata(key);
|
||||
if (!metadata)
|
||||
continue;
|
||||
object_metadata = *metadata;
|
||||
}
|
||||
else
|
||||
object_metadata = object_storage->getObjectMetadata(key);
|
||||
|
@ -0,0 +1,2 @@
|
||||
21 Str21
|
||||
22 Str22
|
@ -0,0 +1,9 @@
|
||||
-- Tags: no-fasttest
|
||||
|
||||
SELECT * FROM s3(
|
||||
'http://localhost:11111/test/03036_json_archive.zip :: example11.jsonl',
|
||||
JSONEachRow,
|
||||
'id UInt32, data String'
|
||||
)
|
||||
ORDER BY tuple(*)
|
||||
SETTINGS s3_ignore_file_doesnt_exist=1, use_cache_for_count_from_files=0;
|
Loading…
Reference in New Issue
Block a user