INFER_ SCHEMA function: DECFLOAT(38) inferred for high-precision numeric values in CSV and JSON files (Pending)¶
Attention
This behavior change is in the 2026_08 bundle.
For the current status of the bundle, refer to Bundle history.
When the 2026_08 bundle is enabled, the
INFER_SCHEMA function with KIND => 'STANDARD' infers
DECFLOAT(38) for numeric values in CSV
and JSON files that NUMBER and REAL can’t represent without losing digits or numeric value. DECFLOAT(38)
stores up to 38 significant digits with a wide exponent range, so these values stay numeric instead of
losing precision or becoming TEXT. This change applies to CSV and JSON files only. Parquet, ORC, Avro,
and KIND => 'ICEBERG' inference are unchanged.
- Before the change:
INFER_SCHEMAhad no numeric type betweenNUMBERandREALfor a value that fit neither, so it fell back to a type that lost information:- A value with more than 17 significant digits that didn’t fit
NUMBER(38, scale)was inferred asREAL, which keeps only about 17 digits, so the extra precision was lost. - A value outside the range of a double (for example,
1.23e309) was inferred asTEXTin CSV files and asREALin JSON files. - A very small value that underflowed to zero (for example,
1E-453), or a subnormal value with degraded precision, was inferred asREAL. - When the merged precision of two
NUMBERvalues exceeded 38, the scale was truncated to fitNUMBER(38), and a column that mixed different numeric types was inferred asTEXT.
For a CSV file with these columns (
PARSE_HEADER = TRUE):INFER_SCHEMAinferred types that lost precision or numeric value:- A value with more than 17 significant digits that didn’t fit
- After the change:
INFER_SCHEMAinfersDECFLOAT(38)for the same values, keeping them numeric with up to 38 significant digits:A value with more than 38 significant digits is inferred as
DECFLOAT(38)with rounding applied beyond the 38th digit.In JSON files,
INFER_SCHEMAapplies the same rules to unquoted numbers. A quoted numeric string, such as"00123", staysTEXT. A number outside theDECFLOATrange staysTEXT.When a column combines different numeric types (for example,
NUMBERin one file andREALin another), the merged type is nowDECFLOAT(38)instead ofTEXT. If the column containsInfinityorNaN, the merged type staysREAL.The inferred type is intentionally unchanged for:
- Values that fit
NUMBER(38, scale)orREAL. InfinityandNaN, which stayREALbecauseDECFLOATdoesn’t support special values.KIND => 'ICEBERG', which doesn’t supportDECFLOATcolumns.- Parquet, ORC, and Avro files, which carry their own type metadata.
- Automatic schema evolution for
COPYand Snowpipe Streaming. - Existing tables and stored schemas, which are never rewritten.
- Values that fit
How to update your code¶
No action is required to keep inferring the previous types for values that already fit NUMBER or REAL.
CREATE TABLE … USING TEMPLATE
converts INFER_SCHEMA output into column definitions, so a regular table that you generate from CSV or JSON
files after the bundle is enabled might contain DECFLOAT(38) columns where it previously contained REAL,
NUMBER, or TEXT.
For an external table, an Iceberg table, or a hybrid table, USING TEMPLATE doesn’t accept a DECFLOAT(38)
column, so a template that infers one causes the statement to fail with an unsupported data type error. For
an Iceberg target, use INFER_SCHEMA with KIND => 'ICEBERG', which doesn’t infer DECFLOAT. Otherwise,
define the affected columns explicitly instead of generating them from a template.
If you use schema allowlists, custom type parsers, connectors, ORMs, or SQL that assumes text semantics for
these columns, confirm that they support the DECFLOAT type. For the drivers and versions that support
DECFLOAT, see
Drivers and driver versions that support the DECFLOAT data type;
an unsupported driver returns DECFLOAT values as TEXT. Review the
Limitations for the DECFLOAT data type,
which include features and languages that don’t support DECFLOAT. Existing tables aren’t modified.
Ref: 2374