Commit Graph

1432 Commits

Author SHA1 Message Date
Yatsishin Ilya
e0803064e6 Merge remote-tracking branch 'origin' into default-table-engine 2022-02-07 08:45:32 +00:00
Amos Bird
2debfc922d
Better projection format and test fixes 2022-02-07 10:47:11 +08:00
Alexander Tokmakov
ca5f951558 Merge branch 'master' into mvcc_prototype 2022-02-03 18:56:44 +03:00
Yatsishin Ilya
cce0452d19 add more tests, fix style, fix MATERIALIZED VIEW POPULATE without ENGINE 2022-02-02 18:07:03 +00:00
alexey-milovidov
eeae89388b
Merge pull request #34230 from aaronstephenkatz/patch-1
adding # as a recognized start of single line comment
2022-02-02 03:03:01 +03:00
Sergei Trifonov
68bc456830
Merge pull request #34223 from azat/bump-fmt
Bump fmtlib from 7.0.0 to 8.1.1
2022-02-02 00:03:25 +03:00
Aaron Katz
0cac4b4a6e
adding # as a recognized start of single line comment 2022-02-01 09:40:17 -08:00
Yatsishin Ilya
759574d6f0 improve 2022-02-01 16:59:41 +00:00
Nikolay Degterinsky
56aa60ab88 Add composability to casting and index operators 2022-02-01 15:56:03 +00:00
alexey-milovidov
cafb19d7fb
Merge pull request #34114 from amosbird/replxxwithlexer
Combining our lexer with replxx for better multiple line editing
2022-02-01 16:32:25 +03:00
Yatsishin Ilya
2a698b8da3 Merge remote-tracking branch 'origin/master' into default-table-engine 2022-02-01 13:23:52 +00:00
Azat Khuzhin
bedf208cbd Use fmt::runtime() for LOG_* for non constexpr
Here is oneliner:

    $ gg 'LOG_\(DEBUG\|TRACE\|INFO\|TEST\|WARNING\|ERROR\|FATAL\)([^,]*, [a-zA-Z]' -- :*.cpp :*.h | cut -d: -f1 | sort -u | xargs -r sed -E -i 's#(LOG_[A-Z]*)\(([^,]*), ([A-Za-z][^,)]*)#\1(\2, fmt::runtime(\3)#'

Note, that I tried to do this with coccinelle (tool for semantic
patchin), but it cannot parse C++:

    $ cat fmt.cocci
    @@
    expression log;
    expression var;
    @@

    -LOG_DEBUG(log, var)
    +LOG_DEBUG(log, fmt::runtime(var))

I've also tried to use some macros/templates magic to do this implicitly
in logger_useful.h, but I failed to do so, and apparently it is not
possible for now.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

v2: manual fixes
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-01 14:30:03 +03:00
Alexander Tokmakov
2e4ae37d98 Merge branch 'master' into mvcc_prototype 2022-02-01 13:20:03 +03:00
Ilya Yatsishin
9c2ef98d23
Apply suggestions from code review
Co-authored-by: tavplubix <tavplubix@gmail.com>
2022-02-01 10:03:50 +03:00
Yatsishin Ilya
676fc5b20f Initial commit 2022-01-31 17:10:59 +00:00
Amos Bird
54517753d7
Combining our lexer with replxx 2022-01-30 19:48:33 +08:00
zhangxiao871
7f2f7fa993 Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into yandex-master 2022-01-30 13:46:52 +08:00
zhangxiao871
dd395c5721 Better test. 2022-01-30 13:46:11 +08:00
Maksim Kita
cfd3421e4f Dictionary PRIMARY KEY parsing fix 2022-01-29 15:50:10 +00:00
Alexander Tokmakov
fb9b2d5326 Merge branch 'master' into mvcc_prototype 2022-01-28 21:18:36 +03:00
mergify[bot]
c9a1c9a896
Merge branch 'master' into system_on_cluster 2022-01-28 10:42:26 +00:00
zhangxiao871
78e2794ada Fix START MERGES and add test 2022-01-28 14:30:57 +08:00
Raúl Marín
045c92e2b9 Fix readability issues 2022-01-26 17:36:45 +01:00
Raúl Marín
4b5ab80e3b Better scalar cache handling
- Fixes global CTE scalar cache.
- Adds MVs back (views dependent on the source are cached locally and others globally
2022-01-26 17:36:45 +01:00
zhangxiao871
1bd74dda63 Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into yandex-master 2022-01-26 17:40:32 +08:00
zhangxiao871
20b669f330 Supports all types of SYSTEM query ON CLUSTER clause. 2022-01-26 17:40:00 +08:00
Anton Popov
6cbcfd706f fix conversion function to literal 2022-01-24 15:28:15 +03:00
Anton Popov
3567e18f6e fix 'Not found column' exception in distributed queries with arrays and tuples 2022-01-24 10:46:30 +03:00
Alexander Tokmakov
e3b1397001 Merge branch 'master' into mvcc_prototype 2022-01-21 18:59:01 +03:00
Kruglov Pavel
6f49f0cac6
Don't write additional space in DESCRIBE TABLE query formatting 2022-01-20 21:07:34 +03:00
tavplubix
41ee114abb
Merge pull request #33819 from bigo-sg/optimize_explain_create_function
Support explain create function query
2022-01-20 19:07:43 +03:00
Alexander Tokmakov
0ea0a8ccc7 Merge branch 'master' into mvcc_prototype 2022-01-20 17:05:55 +03:00
Kruglov Pavel
f644602ec8
Merge pull request #33776 from Avogar/fix-insert-values
Fix parsing query INSERT INTO ... VALUES SETTINGS ... (...), ...
2022-01-20 14:09:27 +03:00
taiyang-li
e4f5444073 support explain create function query 2022-01-20 16:23:52 +08:00
Azat Khuzhin
6c0fa21025 Remove unbundled libprotobuf-mutator support 2022-01-20 08:47:16 +03:00
Azat Khuzhin
788cb6b2b0 Remove unbundled protobuf support 2022-01-20 08:47:16 +03:00
Alexander Tokmakov
e9a5a64a71 Merge branch 'master' into mvcc_prototype 2022-01-19 21:41:23 +03:00
avogar
c4cd8c6da4 Fix parsing query INSERT INTO ... VALUES SETTINGS ... (...), ... 2022-01-19 14:22:32 +03:00
alexey-milovidov
d222cb9771
Merge pull request #33695 from amosbird/buildimprove
Some build improvement
2022-01-19 03:19:22 +03:00
Amos Bird
6d62060e16
Build improvement 2022-01-17 22:36:27 +08:00
Eugene Galkin
f46dca4793 support x509 ssl certificate authentication 2022-01-17 15:01:38 +03:00
Azat Khuzhin
16adcc1666 Reduce memory usage for parsing collections (by using move ctor)
In case you pass array in VALUES section (ValuesBlockInputFormat), it
will be copied after it had been created.
This is not significant if array is small, however if you have huge
enough array, then this can become significant (especially for array of
bool, since for each element will be used Field anyway, and it's size is
56 byte).

Here is a simple reproducer:

    $ curl -sS 'http://127.1:8123/?input_format_values_deduce_templates_of_expressions=0' -d@- <<<"insert into function null('_ Int') values (length([0,$(yes 1, | head -n2000000 | tr -d '\n')1]))"

But note, that there is lots of work (evalute constant expressions from #6781)
after parsing collection, and so total memory usage for query does not
changed a lot (hence - no test).

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-15 21:13:05 +03:00
Alexander Tokmakov
4dd216ce8f Merge branch 'master' into mvcc_prototype 2022-01-14 17:11:32 +03:00
avogar
7ea75b3082 Fix parsing queries with FROM INFILE statement again 2022-01-12 12:59:40 +03:00
Kruglov Pavel
dca9753e7a
Delete unecessary line 2022-01-11 20:26:43 +03:00
Kruglov Pavel
186020d906
Update ParserInsertQuery.cpp 2022-01-11 20:24:34 +03:00
mergify[bot]
7999d90900
Merge branch 'master' into auto_format_by_file_extension 2022-01-11 17:21:14 +00:00
tavplubix
6eee1fda56
Merge pull request #33521 from Avogar/fix-from-infile-syntax
Fix parsing queries with FROM INFILE statement
2022-01-11 20:16:24 +03:00
avogar
070fd60b02 Fix parsing queries with FROM INFILE statement 2022-01-11 17:16:54 +03:00
zhongyuankai
146068c911 INTO OUTFILE / FROM INFILE: autodetect FORMAT by file extension 2022-01-11 21:52:09 +08:00
zhongyuankai
f97250aea9 Merge branch 'master' into auto_format_by_file_extension 2022-01-11 21:41:49 +08:00
Maksim Kita
3aeb1279ee IAST QueryKind style fix 2022-01-11 12:31:26 +03:00
Maksim Kita
8aa930b52f
Merge pull request #33294 from ClickHouse/query-kind-concurent_restriction
Add IAST::QueryKind enum and use it in query limiter
2022-01-11 11:23:18 +03:00
Alexander Tokmakov
bf2b6c2c37 Merge branch 'master' into mvcc_prototype 2022-01-10 19:53:50 +03:00
Stig Bakken
3fd93eb90c Print alter command names in EXPLAIN AST 2022-01-10 10:08:41 +01:00
Kseniia Sumarokova
e6ea7c361d
Merge pull request #32836 from stigsb/explain-table-override
Add `EXPLAIN TABLE OVERRIDE` for pre-validating overrides.
2022-01-10 09:58:16 +03:00
Alexey Milovidov
6df2afb5dd One step backwards 2022-01-09 10:42:06 +03:00
Alexey Milovidov
fa0a9aa989 Another try 2022-01-09 08:12:34 +03:00
Alexey Milovidov
5e0edd01f1 Prevent excessive backtracking 2022-01-09 07:42:55 +03:00
Alexey Milovidov
da967a555a Trying 2022-01-09 07:42:53 +03:00
Alexey Milovidov
341fd57e15 Somewhat better 2022-01-09 06:25:12 +03:00
Alexey Milovidov
5dc794c939 Another attempt for #20158 2022-01-09 05:45:54 +03:00
Alexey Milovidov
5ba42d690c Avoid exponential backtracking in parser, part 2 2022-01-09 04:28:24 +03:00
zhongyuankai
878e44eb97 auto format by file extension 2022-01-08 21:47:14 +08:00
Alexey Milovidov
1813e7ad35 Fix clang-tidy 2022-01-08 04:57:13 +03:00
Alexey Milovidov
dfb8f9d4fa Simplification 2022-01-07 08:34:33 +03:00
Alexey Milovidov
96aa6060c1 Improve parser 2022-01-07 08:14:09 +03:00
Alexey Milovidov
4bfea5a83f Merge branch 'master' into parser-simplification 2022-01-07 08:03:33 +03:00
Alexey Milovidov
bf59114cee Make "left" and "right" real functions 2022-01-05 05:32:40 +03:00
Alexey Milovidov
6f40d3a342 Parser simplification (incomplete) 2022-01-05 05:30:01 +03:00
vdimir
ae7e5691b8
Get rid of IAST::getQueryKindString 2021-12-30 12:55:50 +03:00
Stig Bakken
6fbb9f5e87 Implement EXPLAIN TABLE OVERRIDE for pre-validating overrides.
Example:

```sql
EXPLAIN TABLE OVERRIDE mysql('127.0.0.1:3306', 'db', 'table', 'user', 'pw')
    PARTITION BY tuple(toYYYYMM(created), id % 8)
```

Validations done:

 * check that storage overrides do not reference unknown or nullable columns
 * check that default specifier is not modified for columns
2021-12-30 09:02:27 +01:00
Mikhail f. Shiryaev
9169a84671
Add enum QueryKind for IAST class 2021-12-29 15:42:58 +01:00
avogar
8112a71233 Implement schema inference for most input formats 2021-12-29 12:18:56 +03:00
Alexander Tokmakov
8aec3ae94f Merge branch 'master' into mvcc_prototype 2021-12-28 14:24:36 +03:00
alexey-milovidov
0a55fa3dc2
Revert "Grouping sets dev" 2021-12-25 20:30:31 +03:00
Alexander Tokmakov
b7184732d5 Merge branch 'master' into mvcc_prototype 2021-12-22 19:46:09 +03:00
Stig Bakken
1cc70ad524 Remove the possibility of adding columns with table overrides
(except ALIAS columns)

Supporting this properly requires more comprehensive changes.
2021-12-22 08:20:14 +01:00
Kseniia Sumarokova
de7a5dd1e6
Update ExpressionListParsers.cpp 2021-12-21 12:39:31 +03:00
Alexander Tokmakov
9cd49bc0ec Merge branch 'master' into mvcc_prototype 2021-12-20 22:06:22 +03:00
alexey-milovidov
5cd56b127f
Merge pull request #32912 from cmsxbc/fix-wrong-cases-in-gtest-parser
fix wrong testcase in gtest_Parser
2021-12-18 07:51:16 +03:00
alexey-milovidov
6b97af4c63
Merge pull request #26869 from taylor12805/grouping-sets-dev
Grouping sets dev
2021-12-17 20:50:15 +03:00
cmsxbc
ce6987ad4d
fix wrong testcase in gtest_Parser 2021-12-17 20:59:50 +08:00
Alexander Tokmakov
32e62ed5c2 Merge branch 'master' into mvcc_prototype 2021-12-17 10:43:46 +03:00
zhanglistar
e4006b2cfd
Merge branch 'ClickHouse:master' into keepersizeopt 2021-12-17 14:35:19 +08:00
Maksim Kita
33374f8b0a
Merge pull request #31062 from Enmk/Governance/view_comment
Views with comment
2021-12-16 12:27:12 +03:00
alesapin
31600cdcf9 Clang-tidy mocking me 2021-12-15 13:02:17 +03:00
alesapin
d1dcd0adbf Followup 2021-12-15 11:44:18 +03:00
alesapin
2e8b75ade4 Fix configs 2021-12-15 10:45:27 +03:00
Alexander Tokmakov
d7ad72838c Merge branch 'master' into mvcc_prototype 2021-12-14 23:07:52 +03:00
alesapin
9974f10631 Fix clang tidy 2021-12-14 15:34:20 +03:00
Kseniia Sumarokova
a9ca84ff7d
Merge pull request #32325 from stigsb/table-overrides
Add TABLE OVERRIDE feature for MaterializedMySQL databases
2021-12-13 20:39:42 +03:00
zhanglistar
de3aad085d 1. fix ut fail. 2021-12-10 10:26:28 +08:00
Kruglov Pavel
7ba60aa770 Change error codes to SYNTAX_ERROR 2021-12-08 21:29:50 +03:00
avogar
417bd12629 Fix 'APPLY lambda' parsing 2021-12-08 21:29:50 +03:00
Dmitry Novik
f138122259 fix GROUPING SETS formating 2021-12-07 16:44:09 +03:00
Alexander Tokmakov
7fcb79ae72 Merge branch 'master' into mvcc_prototype 2021-12-07 14:39:29 +03:00
Stig Bakken
bb521cd363 Add TABLE OVERRIDE feature for MaterializedMySQL databases 2021-12-07 09:45:02 +01:00
Maksim Kita
4077d769e7
Merge pull request #31949 from Algunenano/parser_speedup
Speedup query parsing
2021-12-05 16:24:45 +03:00
Kseniia Sumarokova
738265eed2
Update ASTCreateQuery.cpp 2021-12-03 18:17:36 +03:00
Maksim Kita
74979a5f01
Merge pull request #31095 from amosbird/addprojection
Function name normalization for ALTER queries
2021-12-03 12:07:07 +03:00
Kruglov Pavel
049b2c0c14
Merge pull request #31072 from MaxWk/feature-support-bool-type
Feature support bool type
2021-12-02 14:50:29 +03:00
mergify[bot]
0f19807b97
Merge branch 'master' into Governance/view_comment 2021-12-02 08:19:03 +00:00
tavplubix
b623a387af
Merge pull request #31887 from ClickHouse/fix_cannot_create_empty_part
Parse partition key value from `partition_id` when need to create part in empty partition
2021-12-01 15:38:46 +03:00
alexey-milovidov
1f9b542ee9
Merge pull request #32003 from cmsxbc/support-postgresql-style-alter-modify-column
Support PostgreSQL style ALTER MODIFY COLUMN
2021-12-01 04:10:41 +03:00
Kseniia Sumarokova
3c348a2998
Merge pull request #8331 from Vxider/window-view
Support for Stream Processing
2021-11-30 18:20:12 +03:00
cmsxbc
366ee3deba
Support PostgreSQL style ALTER MODIFY COLUMN 2021-11-30 21:07:14 +08:00
fanzhou
b94f8878ff 1. refactor ExpressionAnalyzer
2. Update formatAST to support grouping sets query with distributed table
3. modify astExpression to support function in grouping sets
2021-11-30 14:58:55 +03:00
Kseniia Sumarokova
edf1ec776a
Merge pull request #31824 from azat/system-log-tables-recreate-different-engine
Recreate system.*_log tables in case of different engine/partition_by
2021-11-29 22:56:36 +03:00
Raúl Marín
fc48172980 Expected: Drop duplicates 2021-11-29 19:46:51 +01:00
fanzhou
2912344896 grouping sets support multiple group 2021-11-29 18:32:55 +03:00
Raúl Marín
8439f4c96c Inline IParserBase wrappers 2021-11-29 13:09:53 +01:00
Raúl Marín
6218fc4ad5 Inline IParser depth 2021-11-29 13:09:53 +01:00
Raúl Marín
740451c723 Inline Expected add 2021-11-29 13:09:53 +01:00
Raúl Marín
89734819ca Inline TokenIterator 2021-11-29 13:09:53 +01:00
Raúl Marín
e9ae49c68b IParser: Set to vector 2021-11-29 13:09:53 +01:00
mergify[bot]
8d5460b469
Merge branch 'master' into feature-support-bool-type 2021-11-29 11:50:18 +00:00
Alexander Tokmakov
2fb00172a9 try parse partition key value from partition_id 2021-11-27 15:07:08 +03:00
Raúl Marín
7781fc12ed Reduce dependencies on ASTSelectWithUnionQuery.h
521 -> 77 files requiring changes
2021-11-26 19:27:16 +01:00
MaxTheHuman
3418de337a development 2021-11-26 20:37:51 +03:00
Raúl Marín
f0ee0724ac Reduce dependencies on ASTSelectQuery.h
243 -> 152
2021-11-26 18:35:24 +01:00
Raúl Marín
b2cfa70541 Reduce dependencies on ASTFunction.h
481 -> 230
2021-11-26 18:21:54 +01:00
Raúl Marín
91bf938075 Reduce dependencies on ASTLiteral.h
590 -> 537
2021-11-26 17:54:57 +01:00
Raúl Marín
ac6ccf7d9a Reduce IParser.h dependencies and dependents
533 -> 500 objects on change
Less direct dependencies
2021-11-26 17:19:47 +01:00
Raúl Marín
0b6ae2e508 Reduce dependencies on IParser.h
533 -> 500 files rebuilt on change
2021-11-26 17:04:21 +01:00
Raúl Marín
051dddd8df Reduce dependencies on ASTIdentifier.h
Goes from rebuilding 483 objects to 165 when it's modified
2021-11-26 16:49:40 +01:00
Azat Khuzhin
89d2270e1d Add ability to reset any type of AST 2021-11-26 10:05:20 +03:00
Nikita Mikhaylov
619ad46340
Fix oss-fuzz build (#31818) 2021-11-26 01:14:34 +03:00
kssenii
223048d395 Merge branch 'master' of github.com:ClickHouse/ClickHouse into vxider-window-view 2021-11-26 01:06:06 +03:00
MaxTheHuman
391a6019d1 fixes 2021-11-23 17:58:16 +03:00
MaxTheHuman
66e74a8907 fix typo 2021-11-23 17:58:16 +03:00
MaxTheHuman
8b95b7d271 init commit with parsing and BAD realisation 2021-11-23 17:58:16 +03:00
Anton Popov
43cfa4467b
Merge pull request #31476 from CurtizJ/merging-constraints
Merging #18787 (Constraints)
2021-11-22 15:57:59 +03:00
kssenii
fda66adf52 Correct merge with master 2021-11-20 13:47:55 +03:00
kssenii
29978f9707 Merge branch 'master' of github.com:ClickHouse/ClickHouse into vxider-window-view 2021-11-20 12:13:39 +03:00
kssenii
5c9509d68b Fix attach 2021-11-20 12:03:39 +03:00
kssenii
9bdad8ab64 Rewrite from DataStreams to Processors 2021-11-19 16:09:12 +03:00
Vitaly Baranov
af56b20da7 Rename IAccessEntity::Type -> AccessEntityType and move it to Access/Common. 2021-11-19 02:48:00 +03:00
Vitaly Baranov
06077a2952 Rename Quota::KeyType -> QuotaKeyType and move it to Access/Common. 2021-11-19 00:14:23 +03:00
Vitaly Baranov
6634fcbac7 Rename Quota::ResourceType -> QuotaType and move it to Access/Common. 2021-11-19 00:14:23 +03:00
Vitaly Baranov
33ea7a7262 Rename RowPolicy::ConditionType -> RowPolicyFilterType and move it to Access/Common. 2021-11-19 00:14:23 +03:00
Vitaly Baranov
2883ca012e Rename RowPolicy::NameParts -> RowPolicyName and move it to Access/Common. 2021-11-19 00:14:23 +03:00
kssenii
6a39d871b2 Merge branch 'master' of github.com:ClickHouse/ClickHouse into vxider-window-view 2021-11-18 17:29:11 +03:00
Alexander Tokmakov
06bed68f6e Merge branch 'master' into mvcc_prototype 2021-11-17 23:03:19 +03:00
Anton Popov
dfb9bc2a01 minor fixes in constraints 2021-11-17 18:43:02 +03:00
Nikolay Degterinsky
64927938c6 Minor refactor 2021-11-16 08:58:28 +00:00
Nikolay Degterinsky
ba50e8387d Merge branch 'master' into query_parameters 2021-11-15 19:55:54 +00:00
Nikolay Degterinsky
5c5897c1cd Apply suggestions from code review
Co-authored-by: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com>
2021-11-15 17:57:26 +00:00
Alexander Tokmakov
ce2f692bb4 Merge branch 'master' into mvcc_prototype 2021-11-15 14:56:50 +03:00
tavplubix
8916d3bebf
Merge pull request #31305 from ClickHouse/rename_support_ifexists
Merging #31081
2021-11-12 15:22:43 +03:00