0

I am trying to create a table with map datatype in clickhouse but it is giving this error.

query: CREATE TABLE table_map (a Map(String, UInt64)) ENGINE=Memory;

Received exception from server (version 21.3.4):
Code: 44. DB::Exception: Received from localhost:9000. DB::Exception: Cannot create table with column 'a' which type is 'Map(String,UInt64)' because experimental Map type is not allowed. Set 'allow_experimental_map_type = 1' setting to enable.

How do I turn this feature on ? I am not able to figure it out.

  • see the official docs - https://clickhouse.tech/docs/en/sql-reference/data-types/map/ - *"To work with it you must 'SET allow_experimental_map_type = 1;'"*. – vladimir Apr 05 '21 at 14:27

1 Answers1

1

you can enable it in default profile

cat /etc/clickhouse/users.d/allow_experimental_map_type.xml
<?xml version="1.0"?>
<yandex>
    <profiles>
        <default>
             <allow_experimental_map_type>1</allow_experimental_map_type>
         </default>
    </profiles>
</yandex>
Denny Crane
  • 11,574
  • 2
  • 19
  • 30