From fa29c2f00d53d272007640bf691f1c5facc64860 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 8 Nov 2020 20:22:21 +0300 Subject: [PATCH] More normal --- .../EmbeddedRocksDBBlockInputStream.cpp | 3 +- .../EmbeddedRocksDBBlockOutputStream.cpp | 4 ++- .../RocksDB/StorageEmbeddedRocksDB.cpp | 28 +++++++++---------- src/Storages/RocksDB/StorageEmbeddedRocksDB.h | 14 ++++++---- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/Storages/RocksDB/EmbeddedRocksDBBlockInputStream.cpp b/src/Storages/RocksDB/EmbeddedRocksDBBlockInputStream.cpp index 767c183f8d5..b7602f8bedb 100644 --- a/src/Storages/RocksDB/EmbeddedRocksDBBlockInputStream.cpp +++ b/src/Storages/RocksDB/EmbeddedRocksDBBlockInputStream.cpp @@ -2,9 +2,8 @@ #include #include #include -#include -#include +#include namespace DB diff --git a/src/Storages/RocksDB/EmbeddedRocksDBBlockOutputStream.cpp b/src/Storages/RocksDB/EmbeddedRocksDBBlockOutputStream.cpp index b00901d6033..a3a0ddb4348 100644 --- a/src/Storages/RocksDB/EmbeddedRocksDBBlockOutputStream.cpp +++ b/src/Storages/RocksDB/EmbeddedRocksDBBlockOutputStream.cpp @@ -1,8 +1,10 @@ - #include #include #include +#include + + namespace DB { diff --git a/src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp b/src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp index 38025a997d2..977b80bc348 100644 --- a/src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp +++ b/src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp @@ -1,10 +1,10 @@ -#include -#include -#include -#include #include #include #include + +#include +#include + #include #include #include @@ -12,28 +12,26 @@ #include #include #include -#include -#include -#include #include -#include #include +#include + #include #include #include #include -#include -#include -#include -#include #include #include #include #include +#include +#include + + namespace DB { @@ -213,9 +211,11 @@ public: ReadBufferFromString key_buffer(slices_keys[i]); ReadBufferFromString value_buffer(values[i]); - for (const auto [idx, column_type] : ext::enumerate(sample_block.getColumnsWithTypeAndName())) + size_t idx = 0; + for (const auto & elem : sample_block) { - column_type.type->deserializeBinary(*columns[idx], idx == primary_key_pos? key_buffer: value_buffer); + elem.type->deserializeBinary(*columns[idx], idx == primary_key_pos ? key_buffer : value_buffer); + ++idx; } } } diff --git a/src/Storages/RocksDB/StorageEmbeddedRocksDB.h b/src/Storages/RocksDB/StorageEmbeddedRocksDB.h index 209f70ceb52..bd700a35809 100644 --- a/src/Storages/RocksDB/StorageEmbeddedRocksDB.h +++ b/src/Storages/RocksDB/StorageEmbeddedRocksDB.h @@ -1,14 +1,15 @@ #pragma once +#include #include #include -#include -#include -#include -#include "rocksdb/db.h" -#include "rocksdb/table.h" +namespace rocksdb +{ + class DB; +} + namespace DB { @@ -38,7 +39,8 @@ public: bool supportsParallelInsert() const override { return true; } bool supportsIndexForIn() const override { return true; } - bool mayBenefitFromIndexForIn(const ASTPtr & node, const Context & /*query_context*/, const StorageMetadataPtr & /*metadata_snapshot*/) const override + bool mayBenefitFromIndexForIn( + const ASTPtr & node, const Context & /*query_context*/, const StorageMetadataPtr & /*metadata_snapshot*/) const override { return node->getColumnName() == primary_key; }