Commit Graph

4096 Commits

Author SHA1 Message Date
alexey-milovidov
fa0274e223
Merge pull request #7380 from hczhcz/patch-1018
Add function arrayFill and arrayReverseFill
2019-11-03 01:06:41 +03:00
alexey-milovidov
dea9220e3c
Merge pull request #7542 from hczhcz/patch-1030
Fix "create as select" parsing
2019-11-02 00:58:09 +03:00
alexey-milovidov
ad01f7b1ac
Merge pull request #7552 from azat/do-not-account-memory-for-Buffer-in-max_memory_usage
[RFC] Do not account memory for Buffer engine in max_memory_usage limit
2019-11-02 00:57:24 +03:00
alexey-milovidov
dda93e2275
Merge pull request #7561 from ClickHouse/achimbab-master
Merge for #7363
2019-11-02 00:57:13 +03:00
chertus
334b91f351 revrite NonJoinedBlockInputStream (in progress) 2019-11-01 20:41:07 +03:00
alexey-milovidov
4081b0be90
Merge pull request #7497 from amosbird/countopt
Early constant folding.
2019-11-01 16:54:02 +03:00
Amos Bird
5333258e7e
Complement to tuple parser 2019-11-01 10:48:15 +08:00
Azat Khuzhin
dbe45800d9 Do not account memory for Buffer engine in max_memory_usage limit
Since background flush will not be accounted there, and it can be too
tricky to calclulate this limit, in case you have multiple materialized
views with Buffer engine.

v2: test adjustment
2019-10-31 22:26:50 +03:00
Amos Bird
e04cdd4ebb
Early constant folding. 2019-10-31 23:54:32 +08:00
Amos Bird
4aff9a20c6
Better parser 2019-10-31 23:22:48 +08:00
alexey-milovidov
417c008700
Update 01021_create_as_select.sql 2019-10-31 11:29:30 +03:00
hcz
4c7a54113d Add tests 2019-10-31 11:33:23 +08: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
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
alexey-milovidov
ddb58eeb8b
Merge pull request #7510 from amosbird/smartcount
Instant count() for MergeTree
2019-10-30 20:42:00 +03:00
alesapin
7f4e982d13 Add tests 2019-10-30 17:51:30 +03:00
chertus
deb2406b30 fix JOIN right table keys nullability 2019-10-29 22:39:42 +03:00
Amos Bird
1eb44c6837
Add missing tests 2019-10-29 22:26:43 +08: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
sundy-li
00389a67a0 add more tests 2019-10-29 14:55:59 +08:00
sundy-li
dbd3227e5a fixup partial const column 2019-10-29 11:51:27 +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
sundy-li
538b77c123 functions: add char function as mysql behavior 2019-10-28 10:44:56 +08: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
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
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
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
alesapin
a6199b7e69 Merge with master 2019-10-24 12:33:40 +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
Artem Zuikov
bb1c1d0ed9
Merge pull request #7431 from arenadata/master
fix aggregation (avg and quantiles) over empty decimal columns.
2019-10-23 20:28:35 +03:00
alesapin
c3519ff376 Better check of dictionary lifetime for updates 2019-10-23 16:02:40 +03:00
akonyaev
7426542b8b up precision for avg result to max of type 2019-10-23 11:22:51 +03:00
alexey-milovidov
ffc2e4e149
Merge pull request #7396 from nvartolomei/nv/mv-extra-columns
Test materialized view pushing extra columns
2019-10-23 07:30:53 +03:00
akonyaev
6d0dbf7e95 add test returned datatype from quantile and median result for empty decimal data 2019-10-22 18:51:34 +03:00
akonyaev
71dd3a303e fix result type for avg aggregation 2019-10-22 18:31:56 +03:00
akonyaev
dc7c4c1b9a add tests for aggregation over empty decimal table 2019-10-22 15:30:00 +03:00
Alexander Kuzmenkov
be4618dd05
Merge pull request #7339 from amosbird/f10
Fix preciseExp10
2019-10-22 12:00:53 +03:00
Vitaly Baranov
f611fd4dfa
Merge pull request #7293 from Vdimir/feature/isvalidjson-5910
Add function isValidJSON
2019-10-21 21:24:18 +03:00
alesapin
83dbfe9634 New tests and fixes for them 2019-10-21 20:09:41 +03:00
Amos Bird
a860ee7891
Fix preciseExp10 2019-10-22 00:05:57 +08:00
chertus
4f0859a5fa Merge branch 'master' into ast 2019-10-21 15:08:05 +03:00
chertus
0d708569e3 fix test result (disabled push down) 2019-10-21 14:31:16 +03:00
alesapin
26c87e46c9 Merge branch 'master' into dictionaries_ddl_loader 2019-10-21 11:46:49 +03:00
alesapin
35e66d6696 Merge with master 2019-10-21 11:46:11 +03:00
millb
2a183c3d07 Merge branch 'master' into decimal_hex_function 2019-10-21 11:13:51 +03:00
hcz
79a27ece1a Flip the condition column in arrayFill 2019-10-21 11:19:11 +08:00
alexey-milovidov
61125e536b
Update 01019_materialized_view_select_extra_columns.sql 2019-10-20 17:59:26 +03:00
Nicolae Vartolomei
b0f2f23a38 Test materialized view pushing extra columns
This test exists to prevent unintended changes to existing behaviour.

Although this behaviour might not be ideal it is can be exploited for 0-downtime changes to materialized views.

Step 1: Add new column to source table.
Step 2: Create new view reading source column.
Step 3: Swap views using `RENAME TABLE`.
Step 4: Add new column to destination table as well.
2019-10-20 10:26:44 +01:00
alexey-milovidov
52bfa9927c
Merge pull request #7384 from ClickHouse/fix_ub_in_system_parts
Fix UB in StoragesInfoStream
2019-10-19 09:59:39 +03:00
VDimir
f1630b4e2e Merge branch 'master' into feature/isvalidjson-5910 2019-10-19 06:21:21 +00:00
chertus
c5a850240c better ambiguous column detection in multiple join rewriter 2019-10-18 20:09:17 +03:00
chertus
37f07213ee better test 2019-10-18 19:45:59 +03:00
chertus
1bb8174285 disable push down for CROSS JOIN tests 2019-10-18 19:34:06 +03:00
chertus
2533652847 columns match priority: table alias > table name> aliased table name 2019-10-18 19:16:57 +03:00
alesapin
a014924c19 Remove wrong tests 2019-10-18 19:04:12 +03:00
Alexander Kuzmenkov
5e2cc37381
Distinguish Array and Tuple field types when creating from array of Fields. (#7179) 2019-10-18 18:57:05 +03:00
Alexander Tokmakov
06b28f9fe3 fix uninitialized offset for Lazy db 2019-10-18 16:09:24 +03:00
Alexander Kuzmenkov
3143fa37d7
Merge pull request #7371 from CurtizJ/fix-optimize-read-in-order
Fix optimize_read_in_order with IN and a subquery.
2019-10-18 15:55:53 +03:00
hcz
502672c973 Add aggregate function combinators: -OrNull & -OrDefault (#7331) 2019-10-18 12:25:39 +03:00
hcz
b87fe27cd6 Add tests 2019-10-18 16:45:56 +08:00
chertus
0f6176cc2d throw on ambiguous qualified column 2019-10-18 00:08:28 +03:00
alesapin
b222ec1209 Fix segmentation fault 2019-10-17 20:53:08 +03:00
alesapin
c29b39002d Fix race condition, add test 2019-10-17 20:36:53 +03:00
alesapin
05392fd882 Fix deadlock, add test and refactoring 2019-10-17 20:18:54 +03:00
Alexander Kuzmenkov
b62c9e729d
Merge pull request #7215 from ClickHouse/formats_improvements
Miscellaneous formats improvements
2019-10-17 17:37:38 +03:00
CurtizJ
546414c015 fix optimize_read_in_order with in subquery 2019-10-17 16:11:27 +03:00
alesapin
6dfe5c7142 Better introspection 2019-10-17 16:05:12 +03:00
Ivan
e595df05d9
Fix CREATE TABLE AS from table with virtual columns (#7183)
* Disable undefined instrumentation for rdkafka
2019-10-17 14:12:35 +03:00
philip.han
08a348fbd1 Made IN operator support Array(LowCardinality(Nullable(String))) 2019-10-17 19:08:36 +09:00
memo
ef09cedbb8 fix test bug 2019-10-17 11:38:49 +08:00
Alexander Tokmakov
e9e8d055af null_as_default for Values 2019-10-16 22:55:24 +03:00
Alexander Tokmakov
102cbfd25a fix old bug with default values 2019-10-16 22:27:33 +03:00
alesapin
842a31be8b More tests 2019-10-16 20:59:10 +03:00
alesapin
51de7a1cd1 Better tests 2019-10-16 20:12:53 +03:00
alesapin
fa557ab80d Better tests 2019-10-16 20:11:19 +03:00
alesapin
01e23f0a22 Better load of dictionaries 2019-10-16 20:06:52 +03:00
Alexander Tokmakov
5f6703130e fixes 2019-10-16 18:28:48 +03:00
millb
19a54a59bb Created: function hex for Decimal32, Decimal64, Decimal128 2019-10-16 18:28:10 +03:00
alesapin
b4e0ded048 Almost working 2019-10-16 17:59:52 +03:00
Alexander Tokmakov
aa9d29d6ae Merge branch 'master' into formats_improvements 2019-10-16 17:15:13 +03:00
Artem Zuikov
b70ca30447
Merge pull request #7335 from 4ertus2/ast
Remove asterisk_left_columns_only setting
2019-10-16 13:57:17 +03:00
Artem Zuikov
3ceeb95145
Merge pull request #7282 from 4ertus2/asof
ASOF JOIN inequalities
2019-10-16 13:46:52 +03:00
philip.han
a2bf848e12 Made bloom_filter type of index supporting LowCardinality and Nullable 2019-10-16 15:22:56 +09:00
alesapin
e690a3ca32 Half working code 2019-10-15 21:04:17 +03:00
Artem Zuikov
cf99f88bc4 PartialMergeJoin flush data on disk (#7186) 2019-10-15 19:31:49 +03:00
chertus
9667e54201 remove asterisk_left_columns_only setting 2019-10-15 17:42:57 +03:00
memo
8b1b7f2a5f add arrayCompact test 2019-10-15 16:09:10 +08:00
alexey-milovidov
6a44336b86
Merge pull request #7304 from sundy-li/ttl_check
Check TTL in StorageFactory
2019-10-14 20:11:37 +03:00
Alexander Kuzmenkov
831fb2cbfd
Merge pull request #7283 from ClickHouse/aku/in-unconvertible
Ignore non-convertible values at any depth on the right side of the IN operator
2019-10-14 18:32:22 +03:00
Alexander Kuzmenkov
160d8a6416 Ignore non-convertible values at any depth on the right side of IN
operator.

The values that are not convertible to the left argument type can't
match anyway, so it is safe to discard them.
2019-10-14 14:25:03 +03:00
alesapin
1ce0eb6e63 Appropriate error codes numbers 2019-10-14 13:04:10 +03:00
alesapin
ecde224692 More tests 2019-10-14 12:52:43 +03:00
alexey-milovidov
f0409348a1
Merge pull request #7294 from hczhcz/patch-1013
Add arraySplit
2019-10-14 12:32:09 +03:00
alesapin
67ea66604f Fix segmentation fault in database factory 2019-10-14 12:21:29 +03:00
sundy-li
b2109e4ece Check TTL in StorageFactory 2019-10-14 17:03:39 +08:00
Danila Kutenin
19ecc3e6cf
Merge pull request #7299 from ClickHouse/multi_match_all_indices
Add multi{Fuzzy}MatchAllIndices functions
2019-10-14 10:58:27 +02:00
alesapin
155731a676 Merge branch 'master' into dictionaries_ddl_interpreter 2019-10-14 11:49:18 +03:00