Commit Graph

35 Commits

Author SHA1 Message Date
Smita Kulkarni
dd8df3347b Addressed style review comments and removed bool variables assignment from Clone of ASTs - 40907 Parameterized views as table functions 2022-12-16 11:11:19 +01:00
Smita Kulkarni
1dde95b6e7 Updated hasQueryParameters using mutable optional bool and typo comment fixed - 40907 Parameterized views as table functions 2022-10-20 10:31:41 +02:00
Smita Kulkarni
614fd4cf42 Added is_parameterized_view to Context and removed flag from ASTs, updated to use tryGetTable, addressed review comments - 40907 Parameterized views as table functions 2022-10-17 18:11:22 +02:00
Smita Kulkarni
e256b32fd5 Fixed clang-tidy non-const function issue - 40907 Parameterized views as table functions 2022-10-06 08:55:15 +02:00
Smita Kulkarni
ec95294621 Merge branch 'master' into 40907_Parameterized_views_as_table_functions 2022-10-05 11:48:14 +02:00
Smita Kulkarni
7033a56ff2 Moved QueryParameterVisitor to Parsers & EXPLAIN SYNTAX test fix - 40907 Parameterized views as table functions 2022-10-03 16:42:44 +02:00
Smita Kulkarni
e5c0c6a1b6 Addressed review comments - 40907 Parameterized views as table functions
Implementation
* Updated handling of has_query_parameters to avoid recalculation.
* Fixed style comments
* Updated formatImpl of ASTTableExpression to prioritise table_function before sub_query.
Testing:
* Added test for ATTACH, DETACH, INSERT INTO view and EXPLAIN SYNTAX to tests/queries/0_stateless/02428_parameterized_view.sql
2022-10-03 14:27:38 +02:00
Nikolay Degterinsky
1626aba16e Add default UNION/EXCEPT/INTERSECT to the echo query text 2022-09-28 00:59:50 +00:00
Smita Kulkarni
bbc33a54b2 Addressed review comments - 40907 Parameterized views as table functions
Implementation
* Fix for clang-today build fails - updated to use const in Context.cpp & const function in ActionsVisitior.cpp
* Updated to use QueryParameterVisitor to check if query has query parameters
* Updated executeTableFunction to check if table/table exists instead of try-catch approach
* Fixed small review comments and style comments.
Documentation:
* Addressed review comments and added the LIVE view part which was removed by mistake in the previous commits.
2022-09-27 16:30:59 +02:00
Smita Kulkarni
4fb1dffb9e 40907 Parameterized views as table functions
Implementation
* Fix for clang-today build fails - updated to use const reference in ASTSelectQuery.cpp & ASTSelectWithUnionQuery.cpp
2022-09-26 13:08:54 +02:00
Smita Kulkarni
456baddbc7 40907 Parameterized views as table functions
Implementation
* Fix for Build fails - updated conversion of Field to String and includes
2022-09-24 12:01:18 +02:00
Smita Kulkarni
f801772a86 40907 Parameterized views as table functions
Implementation:
* Updated parsers by adding a bool allow_query_parameters while creating ordinary view, which is used in interpreters to allow query parameters in SELECT.
* Added a check in ActionsVisitor if multiple parameters have same names while creating parameterised view.
* Added bool in StorageView to represent parameterized view.
* Updated processing of SELECT with parameter values to check for views and added substitution of values in the query parameters.

Testing:
* Added a test tests/queries/0_stateless/02428_parameterized_view.sql

Documentation:
* Updated the english documentation for VIEW.
2022-09-23 14:04:43 +02:00
Duc Canh Le
8590cc46c4 implement intersect + except distinct 2022-08-30 18:09:01 +08:00
Raúl Marín
7781fc12ed Reduce dependencies on ASTSelectWithUnionQuery.h
521 -> 77 files requiring changes
2021-11-26 19:27:16 +01:00
Raúl Marín
f0ee0724ac Reduce dependencies on ASTSelectQuery.h
243 -> 152
2021-11-26 18:35:24 +01:00
Kseniia Sumarokova
78105ecba7
Merge pull request #27757 from kssenii/fix-intersect-cast
Fix intersect/except with limit
2021-08-17 21:37:37 +03:00
Kseniia Sumarokova
0950584f88
Update ASTSelectWithUnionQuery.cpp 2021-08-17 11:49:02 +03:00
kssenii
2239ae91a3 Fix 2021-08-17 10:57:13 +03:00
kssenii
844e04e341 Fix 2021-08-16 15:32:44 +03:00
Azat Khuzhin
8b438bcd3c Change formatting of subqueries (make it more human friendly)
Fix trailing whitespaces in FROM/IN clause with subqueries in multiline
mode, and also changes the output of the queries slightly in a more
human friendly way.

Before:

    $ clickhouse-format <<<'select * from system.one, (select * from system.one)'
    SELECT *
    FROM system.one
    ,
    (
        SELECT *
        FROM system.one
    )

After:

    $ clickhouse-format <<<'select * from system.one, (select * from system.one)'
    SELECT *
    FROM system.one,
    (
        SELECT *
        FROM system.one
    )

v2: Fix subqueries formatting in a different way
v3: Adjust *.reference in tests
v4: Fix modernize-loop-convert in ASTTablesInSelectQuery
2021-05-20 21:04:12 +03:00
feng lv
b7e5c6ed4d fix conflict 2020-11-12 02:26:21 +00:00
Alexander Tokmakov
62ff00ee8b use WriteBuffer in formatAST(...) 2020-11-09 19:05:40 +03:00
feng lv
b4c933e585 fix
fix test
2020-11-09 16:03:52 +00:00
feng lv
125eb02726 nomalize ASTSelectWithUnionQuery 2020-11-07 11:38:20 +00:00
feng lv
1a34abadbc fix
fix

fix
2020-11-02 10:46:58 +00:00
feng lv
7159affda8 fix 2020-11-02 06:53:09 +00:00
feng lv
3dce3c6a21 fix 2020-11-02 05:28:37 +00:00
feng lv
af45cddbc7 fix 2020-11-01 14:43:29 +00:00
feng lv
382fff9009 fix 2020-11-01 13:54:07 +00:00
feng lv
7bfd5d9e8d need fix 2020-10-28 01:29:09 +00:00
feng lv
a9e4c7144c fix 2020-10-26 09:33:34 +00:00
feng lv
dcf4b0df1f fix 2020-10-24 14:03:15 +00:00
feng lv
b2a3ace6d1 fix 2020-10-24 13:41:20 +00:00
feng lv
15e4e03469 add union distinct and setting union_default_mode 2020-10-24 13:18:04 +00:00
Ivan Lezhankin
06446b4f08 dbms/ → src/ 2020-04-03 18:14:31 +03:00