ClickHouse® is a real-time analytics DBMS
Go to file
Alexander Kuzmenkov 29052b6a37
Merge pull request #7377 from azat/INSERT-Distributed-MATERIALIZED-cols
* Fix INSERT into Distributed non local node with MATERIALIZED columns

Previous patch e527def18a ("Fix INSERT
into Distributed() table with MATERIALIZED column") fixes it only for
cases when the node is local, i.e. direct insert.

This patch address the problem when the node is not local
(`is_local == false`), by erasing materialized columns on INSERT into
Distributed.

And this patch fixes two cases, depends on `insert_distributed_sync`
setting:

- `insert_distributed_sync=0`

    ```
    Not found column value in block. There are only columns: date. Stack trace:

    2. 0x7ffff7be92e0 DB::Exception::Exception() dbms/src/Common/Exception.h:27
    3. 0x7fffec5d6cf6 DB::Block::getByName(...) dbms/src/Core/Block.cpp:187
    4. 0x7fffec2fe067 DB::NativeBlockInputStream::readImpl() dbms/src/DataStreams/NativeBlockInputStream.cpp:159
    5. 0x7fffec2d223f DB::IBlockInputStream::read() dbms/src/DataStreams/IBlockInputStream.cpp:61
    6. 0x7ffff7c6d40d DB::TCPHandler::receiveData() dbms/programs/server/TCPHandler.cpp:971
    7. 0x7ffff7c6cc1d DB::TCPHandler::receivePacket() dbms/programs/server/TCPHandler.cpp:855
    8. 0x7ffff7c6a1ef DB::TCPHandler::readDataNext(unsigned long const&, int const&) dbms/programs/server/TCPHandler.cpp:406
    9. 0x7ffff7c6a41b DB::TCPHandler::readData(DB::Settings const&) dbms/programs/server/TCPHandler.cpp:437
    10. 0x7ffff7c6a5d9 DB::TCPHandler::processInsertQuery(DB::Settings const&) dbms/programs/server/TCPHandler.cpp:464
    11. 0x7ffff7c687b5 DB::TCPHandler::runImpl() dbms/programs/server/TCPHandler.cpp:257
    ```

- `insert_distributed_sync=1`

    ```
    2019.10.18 13:23:22.114578 [ 44 ] {a78f669f-0b08-4337-abf8-d31e958f6d12} <Error> executeQuery: Code: 171, e.displayText() = DB::Exception: Block structure mismatch in RemoteBlockOutputStream stream: different number of columns:
    date Date UInt16(size = 1), value Date UInt16(size = 1)
    date Date UInt16(size = 0): Insertion status:
    Wrote 1 blocks and 0 rows on shard 0 replica 0, 127.0.0.1:59000 (average 0 ms per block)
    Wrote 0 blocks and 0 rows on shard 1 replica 0, 127.0.0.2:59000 (average 2 ms per block)
     (version 19.16.1.1) (from [::1]:3624) (in query: INSERT INTO distributed_00952 VALUES ), Stack trace:

    2. 0x7ffff7be92e0 DB::Exception::Exception() dbms/src/Common/Exception.h:27
    3. 0x7fffec5da4e9 DB::checkBlockStructure<void>(...)::{...}::operator()(...) const dbms/src/Core/Block.cpp:460
    4. 0x7fffec5da671 void DB::checkBlockStructure<void>(...) dbms/src/Core/Block.cpp:467
    5. 0x7fffec5d8d58 DB::assertBlocksHaveEqualStructure(...) dbms/src/Core/Block.cpp:515
    6. 0x7fffec326630 DB::RemoteBlockOutputStream::write(DB::Block const&) dbms/src/DataStreams/RemoteBlockOutputStream.cpp:68
    7. 0x7fffe98bd154 DB::DistributedBlockOutputStream::runWritingJob(DB::DistributedBlockOutputStream::JobReplica&, DB::Block const&)::{lambda()#1}::operator()() const dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp:280
    <snip>
    ````

Fixes: #7365
Fixes: #5429
Refs: #6891

* Cover INSERT into Distributed with MATERIALIZED columns and !is_local node

I guess that adding new cluster into server-test.xml is not required,
but it won't harm.

* Update DistributedBlockOutputStream.cpp
2019-10-24 12:35:09 +03:00
.github Labeler seems to require additional permissions from PR authors (#7466) 2019-10-24 08:56:53 +08:00
cmake Better add_globs 2019-10-22 15:09:49 +08:00
contrib Merge pull request #7388 from amosbird/ubunaligned 2019-10-19 06:21:20 +03:00
dbms Merge pull request #7377 from azat/INSERT-Distributed-MATERIALIZED-cols 2019-10-24 12:35:09 +03:00
debian Auto version update to [19.17.1.1] [54428] 2019-10-21 15:48:00 +03:00
docker Revert "Update Dockerfile for binary packager (#7456)" (#7458) 2019-10-23 18:54:18 +03:00
docs fix typo in ontime.md (#7285) 2019-10-23 18:32:42 +03:00
libs Fix preciseExp10 2019-10-22 00:05:57 +08:00
utils Wait for jobs to finish on exception (fixes rare segfaults) (#7350) 2019-10-17 17:41:27 +03:00
website CLICKHOUSE-4669: some product placement (#7148) 2019-09-30 11:47:01 +03:00
.clang-format Fix style 2018-12-10 18:50:58 +03:00
.editorconfig Changed tabs to spaces in editor configs and in style guide [#CLICKHOUSE-3]. 2017-04-01 11:35:09 +03:00
.gitattributes Better stats on github [#METR-20000]. 2016-05-04 18:03:17 +03:00
.gitignore Added .yaspellerrc 2019-10-14 13:34:27 +03:00
.gitlab-ci.yml fix ci 2018-02-06 13:13:44 +03:00
.gitmodules Replace libsparsehash with sparsehash-c11 2019-09-18 00:08:20 +03:00
.potato.yml Update comments in .potato.yml 2019-10-20 12:50:33 +08:00
.vimrc Changed tabs to spaces in editor configs and in style guide [#CLICKHOUSE-3]. 2017-04-01 11:35:09 +03:00
AUTHORS CLICKHOUSE-2720: progress on website and reference (#886) 2017-06-20 17:19:03 +03:00
CHANGELOG.md Update CHANGELOG.md 2019-10-09 02:15:51 +03:00
CMakeLists.txt Enable musl and jemalloc for arm. 2019-10-14 00:06:54 +08:00
CONTRIBUTING.md Grammatical mistake 2019-10-09 14:30:04 +05:30
docker-compose.yml Updated docker-compose.yml #1025 2017-07-26 20:05:32 +03:00
format_sources allow several <graphite> targets (#603) 2017-03-21 23:08:09 +04:00
LICENSE Duplicate copyright 2019-07-04 15:03:43 +03:00
PreLoad.cmake Disable ninja for CLion 2019-09-11 10:23:20 +03:00
README.md Remove links to past and almost past meetups 2019-10-20 11:05:17 +08:00
release Initial fuzzing support with libfuzzer 2019-09-22 13:34:09 +03:00
SECURITY.md Changed repository URL 2019-09-23 19:18:19 +03:00
uncrustify.cfg Better .clang-format and uncrustify.cfg 2018-11-29 15:45:34 +03:00

ClickHouse — open source distributed column-oriented DBMS

ClickHouse is an open-source column-oriented database management system that allows generating analytical data reports in real time.

  • Official website has quick high-level overview of ClickHouse on main page.
  • Tutorial shows how to set up and query small ClickHouse cluster.
  • Documentation provides more in-depth information.
  • YouTube channel has a lot of content about ClickHouse in video format.
  • Blog contains various ClickHouse-related articles, as well as announces and reports about events.
  • Contacts can help to get your questions answered if there are any.
  • You can also fill this form to meet Yandex ClickHouse team in person.

Upcoming Events