Commit Graph

82 Commits

Author SHA1 Message Date
alesapin
852757219f Make drop of alias column metadata only 2022-02-21 11:46:16 +03:00
Raúl Marín
b2cfa70541 Reduce dependencies on ASTFunction.h
481 -> 230
2021-11-26 18:21:54 +01:00
Anton Popov
dfb9bc2a01 minor fixes in constraints 2021-11-17 18:43:02 +03:00
Anton Popov
833652e8f4 Merge branch 'nikvas0/simple_optimizations' of git://github.com/nikvas0/ClickHouse into merging-constraints 2021-11-10 19:35:28 +03:00
Anton Popov
476d7a411f allow to remove SAMPLE BY expression 2021-10-14 17:05:20 +03:00
Vasily Nemkov
cb1ca9b33e Implemented modifying table comments with ALTER TABLE t MODIFY COMMENT 'value' 2021-09-23 01:14:00 +03:00
kssenii
710c8d12dd Merge branch 'master' of github.com:ClickHouse/ClickHouse into materialized-postgresql 2021-09-15 12:28:09 +03:00
kssenii
bed2688dad Review fixes 2021-09-09 01:25:08 +03:00
Mike Kot
8e9aacadd1 Initial: replacing hardcoded toString for enums with magic_enum 2021-09-06 16:24:03 +02:00
kssenii
9d0444774a Fix tests 2021-08-29 11:50:03 +03:00
kssenii
4cd62227cf Almost done 2021-08-28 17:34:23 +03:00
vicgao
c16bd25399 modify column datatype to Nullable(datatype) or Nullable(datatype) to Nullable(datatype) donot allways need mutations. 2021-08-17 21:14:13 +08:00
vicgao
b5610d9a83 modify column datatype to Nullable(datatype) or Nullable(datatype) to Nullable(datatype) donot allways need mutations. 2021-08-17 20:52:16 +08:00
Alexander Tokmakov
42a8bb6872 fix assertions in Replicated database 2021-08-02 16:19:11 +03:00
alexey-milovidov
51bf60a938
Merge pull request #17769 from xjewer/alex/remove_engine_setting
CLICKHOUSE-784: reset merge tree setting
2021-07-03 18:27:15 +03:00
Aleksei Semiglazov
9a5365fc41
CLICKHOUSE-784: reset merge tree setting
Add an ability to reset custom setting to default and remove it from table's metadata.
This will allow to rollback the change without knowing the system/config's default.

Signed-off-by: Aleksei Semiglazov <asemiglazov@cloudflare.com>
2021-07-01 20:09:54 +01:00
Aleksei Semiglazov
f47e1ff102
CLICKHOUSE-1194: add skipping index to the beginning of the list
add the FIRST keyword to the ADD INDEX command to be able to add index in the beginning of the list.

Signed-off-by: Aleksei Semiglazov <asemiglazov@cloudflare.com>
2021-07-01 19:37:48 +01:00
Alexey Milovidov
17962459f5 Merge branch 'master' into issue-16775 2021-06-06 02:18:28 +03:00
Amos Bird
edd23d06ad
Fix alter table drop projection if exists 2021-05-28 21:27:36 +08:00
alexey-milovidov
1ed30f7246
Merge branch 'master' into issue-16775 2021-05-22 17:14:23 +03:00
Nikita Vasilev
6102ea643a Merge remote-tracking branch 'upstream/master' into nikvas0/simple_optimizations 2021-05-16 19:51:41 +03:00
Amos Bird
264cff6415
Projections
TODO (suggested by Nikolai)

1. Build query plan fro current query (inside storage::read) up to WithMergableState
2. Check, that plan is simple enough: Aggregating - Expression - Filter - ReadFromStorage (or simplier)
3. Check, that filter is the same as filter in projection, and also expression calculates the same aggregation keys as in projection
4. Return WithMergableState if projection applies

3 will be easier to do with ActionsDAG, cause it sees all functions, and dependencies are direct (but it is possible with ExpressionActions also)

Also need to figure out how prewhere works for projections, and
row_filter_policies.

wip
2021-05-11 18:12:23 +08:00
Nikita Vasilev
af9f811ab5 Merge remote-tracking branch 'upstream/master' into nikvas0/simple_optimizations 2021-05-10 22:08:58 +03:00
Alexey Milovidov
e905883c75 More fixes for PVS-Studio 2021-05-08 19:12:31 +03:00
fibersel
cb53bbb7b0 add experimental codecs flag, add integration test for experimental codecs 2021-05-06 14:57:22 +03:00
Nikita Vasilev
0ec2726bf3 Merge remote-tracking branch 'upstream/master' into nikvas0/simple_optimizations 2021-04-26 17:33:32 +03:00
Nikita Vasilev
4650e36d05 improve constrdescr 2021-04-26 17:19:18 +03:00
Ivan
495c6e03aa
Replace all Context references with std::weak_ptr (#22297)
* Replace all Context references with std::weak_ptr

* Fix shared context captured by value

* Fix build

* Fix Context with named sessions

* Fix copy context

* Fix gcc build

* Merge with master and fix build

* Fix gcc-9 build
2021-04-11 02:33:54 +03:00
Anton Popov
a42b00c9aa Merge remote-tracking branch 'upstream/master' into HEAD 2020-12-17 20:43:23 +03:00
alesapin
2a4a6b22b1 Fix remove TTL for column 2020-12-16 10:26:18 +03:00
Anton Popov
1f65478b49 implement nested with multiple nesting 2020-11-21 20:27:42 +03:00
Alexey Milovidov
e6d8ab2270 Fix possible name collision in ALTER 2020-11-02 21:37:23 +03:00
Ivan
1d170f5745
ASTTableIdentifier Part #1: improve internal representation of ASTIdentifier name (#16149)
* Use only |name_parts| as primary name source

* Restore legacy logic for table restoration

* Fix build

* Fix tests

* Add pytest server config

* Fix tests

* Fixes due to review
2020-10-24 21:46:10 +03:00
alesapin
6732e5c217 Fix alter default validation 2020-10-12 14:02:35 +03:00
alesapin
5ffee8808a
Alter remove column properties and TTLs (#14742) 2020-09-20 16:27:33 +03:00
alesapin
2c4047b280 Revert accident changes 2020-09-11 20:07:00 +03:00
alesapin
6dd75182f0 Better 2020-09-11 20:04:55 +03:00
alesapin
a4c43e51b9 Add a test 2020-09-11 20:04:55 +03:00
alesapin
a5f8899874 First implementation 2020-09-11 20:04:55 +03:00
bharatnc
c377c228ef fix tests 2020-08-31 10:22:53 -07:00
bharatnc
caed8cd474 change error code to BAD_ARGUMENTS (36) 2020-08-31 09:00:32 -07:00
bharatnc
5c83b09a2f disallow CODEC setting for column type ALIAS
This commit adds checks in place during table creation
and updates to ensure that we don't allow `CODEC` for
ALIAS (`default_type` column) like:

```sql
CREATE TABLE compression_codec_on_alias
(
    `c0` ALIAS c1 CODEC(ZSTD),
    `c1` UInt64
)
ENGINE = MergeTree()
PARTITION BY c0
ORDER BY c1;
```

After these safeguards in place, when trying to create/update column
codec, we will get excaptions like this:

```sql

-- create

CREATE TABLE compression_codec_on_alias
(
    `c0` ALIAS c1 CODEC(ZSTD),
    `c1` UInt64
)
ENGINE = MergeTree()
PARTITION BY c0
ORDER BY c1

Received exception from server (version 20.8.1):
Code: 377. DB::Exception: Received from localhost:9000. DB::Exception: Cannot specify codec for column type ALIAS.

0 rows in set. Elapsed: 0.006 sec.

-- modify

ALTER TABLE compression_codec_on_alias
    ADD COLUMN `c3` ALIAS c2 CODEC(ZSTD) AFTER c2

Received exception from server (version 20.8.1):
Code: 377. DB::Exception: Received from localhost:9000. DB::Exception: Cannot specify codec for column type ALIAS.

0 rows in set. Elapsed: 0.005 sec.

```
2020-08-30 23:45:53 -07:00
alesapin
10c7a6c45e
Add ability to specify Default codec for columns (#14049)
* Add ability to specify DefaultCompression codec which correspond to settings specified in config.xml

* Fix style

* Rename DefaultCompression to simple Default

* Fix compression codec

* Better codec description representation

* Less strange code and one method

* Fix delta
2020-08-28 20:40:45 +03:00
Amos Bird
078b14610d
ALTER MODIFY SAMPLE BY 2020-08-27 22:31:30 +08:00
Artem Zuikov
2afd123eda
Refactoring: extract TreeOptimizer from SyntaxAnalyzer (#12645) 2020-07-22 20:13:05 +03:00
alesapin
daaa5cc382 Add setting allow_non_metadata_alters 2020-07-21 17:05:30 +03:00
alesapin
014bb070ec Fix tests 2020-07-14 11:19:39 +03:00
alesapin
1f576ee039 Some intermediate solution 2020-07-13 20:27:52 +03:00
alexey-milovidov
d819624d7c
Merge pull request #12378 from ClickHouse/allow-clear-column-with-dependencies
Allow to CLEAR column even if there are depending DEFAULT expressions
2020-07-10 20:18:14 +03:00
Alexey Milovidov
a4b35a8a6f Allow to CLEAR column even if there are depending DEFAULT expressions #12333 2020-07-10 08:54:35 +03:00