17.10 - HEADER - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
English (United States)

[Optional] Specify whether the first record in the CSV file is a header—that is, whether to skip the first record.

HEADER is disallowed with any of the following:
  • Payload defined with data type DATASET CSV or JSON
  • STOREDAS ('PARQUET')
  • PARTITION BY COLUMN

A header contains the names of the record fields. If you specify HEADER ('FALSE'), Vantage generates field names of the form col_n (col1, col2, …). For more information about headers, see CSV External Files.

HEADER CSV File Has Header CSV File Has No Header
'TRUE' (default) CREATE FOREIGN TABLE skips first record (header) and issues no warning.

You can access record fields only by column names you specify (location_column, data_column_definition [,…]).

CREATE FOREIGN TABLE skips first record.
'FALSE' CREATE FOREIGN TABLE does not skip first record but treats header fields like data fields.

Treating header fields like data fields causes either skipped records (because they cannot be converted to column data types) or invalid rows. Invalid rows can cause unexpected behavior and unexpected results.

CREATE FOREIGN TABLE issues warning for skipped records.

CREATE FOREIGN TABLE does not skip first record and issues no warning.