Hive Row Format

Description

Spark supports a Hive row format in CREATE TABLE and TRANSFORM clause to specify serde or text delimiter. There are two ways to define a row format in row_format of CREATE TABLE and TRANSFORM clauses.

  1. SERDE clause to specify a custom SerDe class.
  2. DELIMITED clause to specify a delimiter, an escape character, a null character, and so on for the native SerDe.

Syntax

row_format:    
    SERDE serde_class [ WITH SERDEPROPERTIES (k1=v1, k2=v2, ... ) ]
    | DELIMITED [ FIELDS TERMINATED BY fields_terminated_char [ ESCAPED BY escaped_char ] ] 
        [ COLLECTION ITEMS TERMINATED BY collection_items_terminated_char ] 
        [ MAP KEYS TERMINATED BY map_key_terminated_char ]
        [ LINES TERMINATED BY row_terminated_char ]
        [ NULL DEFINED AS null_char ]

Parameters