Commit Graph

96 Commits

Author SHA1 Message Date
Pavel Kruglov
775d190fb3 Fix tests 2021-08-09 17:43:10 +03:00
Pavel Kruglov
50d4192126 Implement short circuit function evaluation, first attempt 2021-08-09 17:43:10 +03:00
Vladimir
576b407804
Support conditions in JOIN ON section (#24420)
* Try to enforce table identification in CollectJoinOnKeysMatcher

* Support filtering conditions in JOIN ON for HashJoin

* Correct handle non equi join

* Update test 00878_join_unexpected_results

* Join on filters calculated as one row before join

* Do not lookup key in hash join if condition for row is not hold

* better

* Support filtering conditions in JOIN ON for MergeJoin

* Support Nullable mask in JOIN ON section

* Fix style in Interpreters/TableJoin.cpp

* Change return type of getColumnAsMask in join_common to ColumnPtr

* Handle Nullable(Nothing) type in JOIN ON section, add test cases

* Fix type cast JoinCommon::getColumnAsMask

* Check type if conditions in JOIN ON section, support functions

* Update tests with JOIN ON

* Style changes, add comments for conditions in JOIN ON section

* Add test cases for join on condtions

* JOIN ON key1 = key2 AND (cond1 OR cond2)

* Remove CollectJoinOnKeysVisitor has_join_keys

* Add test cases for join on nullable/lc conditions

* Fix style

* Change error code 48 to 403 in join on tests

* Fix whitespace
2021-07-21 20:03:33 +03:00
Alexey Milovidov
d848e5495c Better implementation 2021-07-12 09:36:46 +03:00
Alexey Milovidov
ff5c433f10 Check for non-deterministic functions in keys, including constant expressions 2021-07-12 08:58:19 +03:00
Maksim Kita
c50909468f Updated ExpressionActionSettings 2021-05-19 17:32:07 +03:00
Maksim Kita
9699299083 Fix build 2021-05-19 16:11:38 +03:00
Maksim Kita
150a88d647 ExpressionActions compile only necessary places 2021-05-19 11:43:16 +03:00
Nikolai Kochetov
c508868570
Merge pull request #23082 from ClickHouse/explain-output
JSON output for EXPLAIN
2021-04-28 15:39:06 +03:00
Alexander Kuzmenkov
06ca44a378 fix pvs warnings 2021-04-22 22:54:58 +03:00
Nikolai Kochetov
9b86c19836 Use JSONBuilder for explain json result. 2021-04-14 17:07:56 +03:00
Nikolai Kochetov
48bcd5b490 Add tree conversion for expression. 2021-04-09 19:18:45 +03:00
Azat Khuzhin
42d858b7e5 Fix LOGICAL_ERROR for Log with nested types w/o columns in the SELECT clause
Found with fuzzer [1]:

<details>

    2021.04.04 10:25:46.762596 [ 135 ] {4b6b5de3-d242-4267-910a-76b235467356} <Fatal> : Logical error: 'Logical error: no information about file column%2Ename.size0 in StorageLog'.
    ...
    2021.04.04 10:25:46.763563 [ 44 ] {} <Trace> BaseDaemon: Received signal 6
    2021.04.04 10:25:46.765884 [ 165 ] {} <Fatal> BaseDaemon: 5. abort @ 0x25859 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
    2021.04.04 10:25:46.901540 [ 165 ] {} <Fatal> BaseDaemon: 6. ./obj-x86_64-linux-gnu/../src/Common/Exception.cpp:51: DB::handle_error_code() @ 0x11cc4f16 in /workspace/clickhouse
    2021.04.04 10:25:47.030755 [ 165 ] {} <Fatal> BaseDaemon: 7. ./obj-x86_64-linux-gnu/../src/Common/Exception.cpp:58: DB::Exception::Exception() @ 0x11cc5025 in /workspace/clickhouse
    2021.04.04 10:25:47.617201 [ 165 ] {} <Fatal> BaseDaemon: 8. ./obj-x86_64-linux-gnu/../src/Storages/StorageLog.cpp:183: DB::LogSource::readData()

</details>

  [1]: https://clickhouse-test-reports.s3.yandex.net/22583/69296876005c0fa171c755f8b224e4d58192c402/fuzzer_debug/report.html#fail1

The problem here is that there is no column%2Ename.size0 there is
column.size0 instead, and it seems that reading sizeX file is not enough
in other places, so just filter them out in
ExpressionActions::getSmallestColumn() (fallback method for storages w/o
getColumnSizes() implemented)
2021-04-05 08:48:04 +03:00
Nikolai Kochetov
c3c393a7aa Merge branch 'master' into refactor-actions-dag 2021-03-18 14:33:07 +03:00
Nikolai Kochetov
5ef5ec4e05 Fix build. 2021-03-10 13:48:08 +03:00
Nikolai Kochetov
4f133ae036 Merge branch 'master' into refactor-actions-dag 2021-03-10 12:40:55 +03:00
Nikolai Kochetov
5ef9d87790 Fix some other tests. 2021-03-10 11:41:24 +03:00
Nikolai Kochetov
fc415952ce Try fix test. 2021-03-05 16:56:44 +03:00
Nikolai Kochetov
c481401b0b Fix build. 2021-03-05 12:54:17 +03:00
Nikolai Kochetov
9a39459888 Refactor ActionsDAG 2021-03-04 20:38:12 +03:00
Nikolai Kochetov
15921fbfcb Remove index by name from ActionsDAG 2021-03-03 23:01:07 +03:00
Nikolai Kochetov
4775ea305e Remove index by name from ActionsDAG 2021-03-02 20:51:54 +03:00
vdimir
a378bd08aa
Perform implicit type conversion for JOIN ON keys 2021-02-19 14:28:40 +03:00
vdimir
435f63f42b
Calculate common type for join using in TreeRewriter
Split before_join and converting_join_columns dags

Add more detailed comments for column type conversion for join using
2021-02-19 14:28:32 +03:00
Nikolai Kochetov
a6f787faea
Merge pull request #19253 from ClickHouse/split-actions-dag
Split actions dag
2021-01-25 18:13:42 +03:00
feng lv
beb0fec8bb mirror changes in code and comment 2021-01-22 09:13:22 +00:00
Nikolai Kochetov
b9c0f2b4c9 Push actions result to begin of block. 2021-01-19 00:54:01 +03:00
Nikolai Kochetov
382e6d0855 Review fix. 2020-11-20 19:52:50 +03:00
Nikolai Kochetov
71d726ea21 Order inputs for ActionsDAG. 2020-11-17 16:20:23 +03:00
Nikolai Kochetov
70f898e667 Order inputs for ActionsDAG. 2020-11-17 15:34:31 +03:00
Nikolai Kochetov
c2f1873f77 Remove comments. 2020-11-16 18:11:55 +03:00
Nikolai Kochetov
e8e6461fa7 Move ActionsDAG to separate file. 2020-11-16 17:57:56 +03:00
Nikolai Kochetov
1a0add5a22 Fix compile expressions 2020-11-12 11:58:36 +03:00
Nikolai Kochetov
46f70dd0de Merge branch 'master' into actions-dag-f14 2020-11-12 11:54:44 +03:00
Nikolai Kochetov
9b13d0e0eb Revert "Add ActionsDAG::updateHeader()"
This reverts commit b78657656c.
2020-11-11 20:17:26 +03:00
Nikolai Kochetov
58c4a7b890 Some renames. 2020-11-11 19:52:27 +03:00
Nikolai Kochetov
a8ddb27c00 Remove comment. 2020-11-11 19:08:48 +03:00
Nikolai Kochetov
aefbc2b48b Try fix tests. 2020-11-11 18:19:27 +03:00
Nikolai Kochetov
4618df5915 Try fix tests. 2020-11-11 18:16:46 +03:00
Nikolai Kochetov
c7f93140b4 Add more comments. 2020-11-11 17:56:56 +03:00
Nikolai Kochetov
4abcd1bcb3 Add more comments. 2020-11-11 17:26:18 +03:00
Nikolai Kochetov
b78657656c Add ActionsDAG::updateHeader() 2020-11-11 16:50:29 +03:00
Nikolai Kochetov
bd15b4e77f Fix tests. 2020-11-11 14:15:25 +03:00
Nikolai Kochetov
d70f9f4175 Move ExecutionContext 2020-11-10 23:36:38 +03:00
Alexander Tokmakov
b94cc5c4e5 remove more stringstreams 2020-11-10 21:22:26 +03:00
Nikolai Kochetov
5b49454622 Update ExpressionActions constructur 2020-11-10 20:05:56 +03:00
Nikolai Kochetov
c6575c9032 Update ExpressionActions constructur 2020-11-10 19:27:55 +03:00
Nikolai Kochetov
1db8e77371 Add comments. Update ActionsDAG::Index 2020-11-10 17:54:59 +03:00
Nikolai Kochetov
74f7f661ca More comments. 2020-11-09 18:01:08 +03:00
Nikolai Kochetov
6717c7a0af Merge branch 'master' into actions-dag-f14 2020-11-09 14:57:48 +03:00