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.
```
This PR adds a new setting called `min_index_granularity_bytes`.
If the `index_granularity_bytes` is > 0 and is lesser than the
`min_index_granularity_bytes`, throw an exception inside the
`registerStorageMergeTree.cpp` file.
This table adds a new table called the `time_zones` table:
```
:) select * from system.time_zones limit 10;
SELECT *
FROM system.time_zones
LIMIT 10
┌─time_zone──────────┐
│ Africa/Abidjan │
│ Africa/Accra │
│ Africa/Addis_Ababa │
│ Africa/Algiers │
│ Africa/Asmara │
│ Africa/Asmera │
│ Africa/Bamako │
│ Africa/Bangui │
│ Africa/Banjul │
│ Africa/Bissau │
└────────────────────┘
10 rows in set. Elapsed: 0.012 sec.
```
The available timezones are parsed from under
`ClickHouse/contrib/cctz/testdata/zoneinfo` through a script
and the table content is constructed from the
StorageSystemTimeZones.generated.cpp`.
I was able to test this locally and was able to get a list of time
zones as shown above.