Custom partitioning.

564 views
Skip to first unread message

Алексей

unread,
Nov 20, 2017, 5:05:44 AM11/20/17
to ClickHouse
I saw latest release (ClickHouse release 1.1.54310) and i was wondering how i can implement "custom partitions" in ClickHouse, so... 

After few attempts to create a table with custom partition key, ClickHouse server noticed to me this error 

"Extended storage definition syntax (PARTITION BY, ORDER BY, SAMPLE BY and SETTINGS clauses) is disabled. Enable it with experimental_allow_extended_storage_definition_syntax user setting".

Help us to understand, how we can  set this flag. Thanks.
Message has been deleted

va...@percona.com

unread,
Nov 20, 2017, 5:24:35 PM11/20/17
to ClickHouse
I have it enabled by having following config in config.xml

<profiles>
    <!-- Default settings -->
    <default>
        <experimental_allow_extended_storage_definition_syntax>1</experimental_allow_extended_storage_definition_syntax>
    </default>
</profiles>

Алексей

unread,
Nov 21, 2017, 3:17:23 AM11/21/17
to ClickHouse
Thanks for your response. Now it works.
Be care, experimental_allow_extended_storage_definition_syntax = 1 is not equal experimental_allow_extended_storage_definition_syntax = true.

tdingus

unread,
Nov 25, 2017, 9:31:29 AM11/25/17
to ClickHouse
I wonder if you could point out what I am missing: 

I did add the setting(below) in clickhouse-server/config.xml

    <profiles>
      <!-- Default settings -->
      <default>
        <experimental_allow_extended_storage_definition_syntax>1</experimental_allow_extended_storage_definition_syntax>
      </default>
    </profiles>

But I still got, "Code: 0. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Extended storage definition syntax (PARTITION BY, ORDER BY, SAMPLE BY and SETTINGS clauses) is disabled. Enable it with experimental_allow_extended_storage_definition_syntax user setting."

I use clickhouse version version 1.1.54313.

Thanks

Jason Piper

unread,
Nov 26, 2017, 9:43:07 AM11/26/17
to ClickHouse
Start a CLI sessios via the clickhouse client (i.e. run "clickhouse client") and then run 

SET experimental_allow_extended_storage_definition_syntax = 1;

Then put your CREATE TABLE command in.

tdingus

unread,
Nov 26, 2017, 5:43:25 PM11/26/17
to ClickHouse
It works. Thanks.
I wonder if it is a bug that the config file doesn't work.

tdingus

unread,
Dec 6, 2017, 1:52:23 PM12/6/17
to ClickHouse
Comparing custom partition by-day and by-month, do we expect any noticeable differences in data ingestion performance?

Alex Zatelepin

unread,
Dec 6, 2017, 2:44:55 PM12/6/17
to ClickHouse
If your INSERT batches contain data belonging to X partitions (days), then one insert is equivalent to X inserts into a single partition, so ingestion performance may degrade accordingly. If you mostly insert data into a single partition, there shouldn't be any difference.

va...@percona.com

unread,
Dec 7, 2017, 10:49:32 AM12/7/17
to ClickHouse
I just tried loading a file with 15bln rows.

With daily partitioning, loading time:
 347m28.575s

With monthly partitioning:
 245m1.150s

tdingus

unread,
Dec 7, 2017, 11:27:48 AM12/7/17
to ClickHouse
Thanks for testing it!

Kuo

unread,
Dec 20, 2017, 8:25:53 AM12/20/17
to ClickHouse
if you want to set this as default, add this setting in users.xml, not config.xml

<yandex>

  <profiles>

    <default>  <experimental_allow_extended_storage_definition_syntax>1</experimental_allow_extended_storage_definition_syntax>

    </default>

  </profiles>

</yandex>

在 2017年11月25日星期六 UTC+8下午10:31:29,tdingus写道:
Reply all
Reply to author
Forward
0 new messages