You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2026/09/04 16:22:00 UTC

[jira] [Assigned] (SPARK-58917) Respect inferSchema for variant ingestion in CSV parser

     [ https://issues.apache.org/jira/browse/SPARK-58917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wenchen Fan reassigned SPARK-58917:
-----------------------------------

    Assignee: Greg Hansen

> Respect inferSchema for variant ingestion in CSV parser
> -------------------------------------------------------
>
>                 Key: SPARK-58917
>                 URL: https://issues.apache.org/jira/browse/SPARK-58917
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 4.4.0
>            Reporter: Greg Hansen
>            Assignee: Greg Hansen
>            Priority: Major
>              Labels: pull-request-available
>
> The CSV to Variant parser (used by the `singleVariantColumn` option and explicit `VariantType` columns) always infers scalar types (long, decimal, date, timestamp, boolean) regardless of the `inferSchema` option, so a value like "0001" is stored as the integer 1 rather than the string "0001".
> A new CSV read option `variantRespectInferSchema` makes the parser honor `inferSchema`: when it is set to true and `inferSchema` is false, scalar CSV values are preserved as strings inside the Variant instead of being inferred.
> The option defaults to false, preserving the existing always-infer behavior so existing results are unchanged; users opt in per read. A reader option allows users to set this on-read via `.option(...)`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org