Ingestion Rules for CSV

<< Click to Display Table of Contents >>

Navigation:  Integrating SQLstream Blaze with Other Systems > Reading Data into s-Server > Reading from Other Sources  > Parser Types for Reading > Reading CSV >

Ingestion Rules for CSV

Previous pageReturn to chapter overviewNext page

s-Server applies the following coercion rules when parsing CSV data. All empty cells are cast as NULL.

CSV Source Cell

numeric string

non-numeric string

BIGINT

DECIMAL

DOUBLE

INT

SMALLINT

REAL

TINYINT

Raise an exception if the JSON number lies beyond the maximum or minimum boundary of the target type. If the number has any decimal digits (including the vacuous .0) and it is being ingested into an integer column, then raise an error.

Raise an error.

BINARY

VARBINARY

Raise an error.

If the string, without quotes, is a valid SQL Standard BINARY literal, then we will ingest it, truncating and 0-filling as necessary. A Standard BINARY literal has the form X'...' where ... is a sequence of (case-insensitive) hex digits.

BOOLEAN

FALSE

If the string is exactly "true", then the result is true. Otherwise, the result is false.

CHAR

VARCHAR

Put double-quotes around the number and then ingest subject to the truncation/padding rules for strings.

If the string won't fit in the target SQL character value, then excess trailing characters are discarded. CHAR values are space-padded up to their declared length.

DATE

TIME

TIMESTAMP

Raise an error.

OK if the string parses as a DATE/TIME/TIMESTAMP. Otherwise, raise an error.

Strings are parsed per ISO standards at https://www.w3.org/TR/NOTE-datetime