Commit Graph

22171 Commits

Author SHA1 Message Date
Azat Khuzhin
920572915e Add regression test for the __getScalar() 2019-11-04 00:31:10 +03:00
Azat Khuzhin
842f4e2ca0 Check column for __getScalar() (avoids assertion)
Can be triggered using the following query:
  CREATE TABLE foo (key String, macro String MATERIALIZED __getScalar(key)) Engine=Null();

Trace:
    3. 0x00007ffff6d5d526 __assert_fail (libc.so.6)
    4. 0x00007ffff41fd931 boost::intrusive_ptr<DB::IColumn const>::operator*() const (libclickhouse_functionsd.so)
    5. 0x00007ffff41fcd64 COW<DB::IColumn>::IntrusivePtr<DB::IColumn const>::operator*() const & (libclickhouse_functionsd.so)
    6. 0x00007ffff4dc5944 DB::FunctionGetScalar::getReturnTypeImpl() const (libclickhouse_functionsd.so)

(Even though it is internal I guess it is better to fix it)

Refs: #7392
Cc: @amosbird
2019-11-03 21:44:56 +03:00
alexey-milovidov
0d2a2c332f
Merge pull request #7366 from achimbab/fixbug_inop
Made IN operator support Array(LowCardinality(Nullable(String)))
2019-10-31 00:26:22 +03:00
alexey-milovidov
88d43488e1
Merge pull request #7412 from 4ertus2/strange
merge_max_block_size in settings
2019-10-31 00:24:43 +03:00
alexey-milovidov
883c868b36
Merge pull request #7523 from ClickHouse/fix-thread-context-attach
Disable context replacement for internal queries
2019-10-31 00:07:13 +03:00
alexey-milovidov
8cfc70aad0
Merge pull request #7551 from ClickHouse/merge-fast-count
Improvements for fast count() after #7510
2019-10-30 23:55:58 +03:00
alexey-milovidov
bb75c7469a
Merge pull request #7545 from ClickHouse/fix_only_tuple_columns
Fix only tuple columns in table.
2019-10-30 23:34:23 +03:00
proller
0006f2a370 Fix build without submodules (#7295)
* Build fixes

*            fix

* Fix

* fix

* Fix install(export..

* Freebsd fixes

* Freebsd fixes

* Fix warning

* fix

* More PRIVATE linking

* Fix review

* Timmy

* Timmy

* fix

* Try fix jemalloc link

* style
2019-10-30 23:34:06 +03:00
Alexey Milovidov
fe73354320 Improvements after #7510 2019-10-30 22:15:55 +03:00
Amos Bird
4609ca3189
Enable bracketed paste if possible 2019-10-31 02:33:45 +08:00
alexey-milovidov
ddb58eeb8b
Merge pull request #7510 from amosbird/smartcount
Instant count() for MergeTree
2019-10-30 20:42:00 +03:00
alesapin
e2424bda4c Fix style 2019-10-30 19:00:40 +03:00
alesapin
7f4e982d13 Add tests 2019-10-30 17:51:30 +03:00
alesapin
2b5ef8bdef Fix bug when table contains only tuple columns 2019-10-30 17:50:59 +03:00
Artem Zuikov
0f68c5a12a
Merge pull request #7530 from 4ertus2/joins
Fix right table key nullability (join_use_keys = 0)
2019-10-30 13:30:27 +03:00
Ivan
4f2f5cca84
Add support for cross-compiling to the CPU architecture AARCH64 (#7370) 2019-10-30 10:01:53 +03:00
chertus
deb2406b30 fix JOIN right table keys nullability 2019-10-29 22:39:42 +03:00
Olga Khvostikova
ff4d90f602
Add test for greatCircleDist 2019-10-29 19:49:37 +03:00
alexey-milovidov
6e837e86e6
Merge pull request #7500 from amosbird/parsernit
Fix DUMP debug.
2019-10-29 19:25:20 +03:00
Amos Bird
1eb44c6837
Add missing tests 2019-10-29 22:26:43 +08:00
chertus
12b57aedf0 remove error prone code 2019-10-29 16:52:05 +03:00
alesapin
cde07dd620 Disable context replacement for internal queries 2019-10-29 13:27:19 +03:00
Amos Bird
2c75a51d4f
Instant count() for MergeTree
Use (Replicated)MergeTree's metadata to do trivial count()
2019-10-29 17:45:47 +08:00
Alexander Kuzmenkov
6e2af3db41
Merge pull request #7480 from azat/crc-v3
Add CRC32IEEE()/CRC64() support
2019-10-28 16:16:37 +03:00
Amos Bird
15d12db16a
Fix DUMP debug. 2019-10-28 19:39:51 +08:00
Alexander Kuzmenkov
c3ea94209b
Merge pull request #7491 from traceon/odbc-bridge-type-mapping-fix
Add handling of SQL_TINYINT and SQL_BIGINT, fix SQL_FLOAT in ODBC Bridge
2019-10-28 13:30:18 +03:00
Nikolai Kochetov
43c8d13de6
Merge pull request #7496 from amosbird/fix15
Fix HAVING without GROUP BY
2019-10-28 02:44:24 +03:00
Amos Bird
77bdfb3350
Fix HAVING without GROUP BY 2019-10-27 22:10:54 +08:00
Azat Khuzhin
04f1e6b2cc Use crc32_z() over crc32(), since it size_t for length 2019-10-25 23:32:29 +03:00
Denis Glazachev
8e48430159 Add handling of SQL_TINYINT and SQL_BIGINT
Fix handling of SQL_FLOAT
2019-10-25 21:49:49 +04:00
Azat Khuzhin
2d2e738085 Add CRC32IEEE()/CRC64() support
zlib's implementation uses CRC-32-IEEE 802.3 polynomial (0xedb88320) but
with starting value 0xffffffff, so introduce another crc32
implementation - CRC32IEEE that has starting value - 0

Also add CRC64 with ECMA polynomial.

v2: s/crc*_data./crc*_data./ to avoid conflicts with other crc32.h in contrib
v3: join with existing CRC32()
2019-10-25 15:52:41 +03:00
alesapin
04ca163518 Merge branch 'master' into dictionaries_ddl_loader 2019-10-25 10:58:04 +03:00
alesapin
8755f5ffa9 Add missed config 2019-10-24 23:08:36 +03:00
Artem Zuikov
df32d92ee5
Merge pull request #7358 from 4ertus2/ast
Better ambiguous column detection
2019-10-24 20:56:23 +03:00
alesapin
5d8d1df802
Merge pull request #7434 from excitoon-favorites/fix-7424
Allowed to have some parts on destination disk or volume in MOVE PARTITION
2019-10-24 19:45:22 +03:00
alexey-milovidov
e865136b2c
Merge pull request #7450 from excitoon-favorites/test-7414
Added integration test for #7414 (validation of `max_data_part_size_bytes`).
2019-10-24 19:23:21 +03:00
chertus
f2028e901d review related changes 2019-10-24 16:04:50 +03:00
chertus
12cd21f3c3 Merge branch 'master' into ast 2019-10-24 15:20:09 +03:00
Artem Zuikov
39b64dff87
Merge pull request #7454 from 4ertus2/refactoring
Refactoring: extract non aliases logic out of QueryNormalizer
2019-10-24 14:34:53 +03:00
Vladimir Chebotarev
64f158ff28 Fixed message for ALTER MOVE PART. 2019-10-24 13:56:32 +03:00
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
Alexander Kuzmenkov
050de71ef4
Update DistributedBlockOutputStream.cpp 2019-10-24 12:33:45 +03:00
alesapin
a6199b7e69 Merge with master 2019-10-24 12:33:40 +03:00
alesapin
7edd80c9b7 Add test for existing dictionary 2019-10-24 12:25:28 +03:00
Vladimir Chebotarev
255da8f5e0 Fixed style. 2019-10-24 12:11:06 +03:00
Vladimir Chebotarev
3debdc2119 Added integration tests for ALTER MOVE PARTITION and fixed minor things. 2019-10-24 11:52:33 +03:00
Vladimir Chebotarev
e8e5cefc35 Fixed integration test for #7414. 2019-10-24 08:59:33 +03:00
chertus
9818eada69 rename: merge_max_block_size 2019-10-24 02:18:21 +03:00
Artem Zuikov
18a72fa91a
Merge pull request #7392 from amosbird/scalar
better scalar query
2019-10-23 22:54:30 +03:00
Azat Khuzhin
80cf86f100 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.
2019-10-23 21:55:08 +03:00