MAP

Represents map data in external tables in the Parquet or ORC format only. A MAP must use only primitive types and may not contain other complex types.

You can use the MAP type in a table definition to consume columns in Parquet or ORC data, but you cannot query those columns. If you want to be able to query the map data, instead define the column as an ARRAY[ROW]. An array of rows can use all supported complex types and can be queried. This is the representation that INFER_EXTERNAL_TABLE_DDL suggests.

Within a single table you must define all map columns using the same approach, MAP or ARRAY[ROW].

Syntax

In column definitions:

MAP<key,value>

Map Input Format for Column Definition

In a column definition in an external table, a MAP consists of a key-value pair, specified as types. The table in the following example defines a map of product IDs to names.

=> CREATE EXTERNAL TABLE store (storeID INT, inventory MAP<INT,VARCHAR(100)>) 
    AS COPY FROM '...' PARQUET;