spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ambar Raghuvanshi (Jira)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-29316) CLONE - schemaInference option not to convert strings with leading zeros to int/long
Date Tue, 01 Oct 2019 13:13:00 GMT

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

Ambar Raghuvanshi updated SPARK-29316:
--------------------------------------
    Issue Type: Bug  (was: Improvement)

> CLONE - schemaInference option not to convert strings with leading zeros to int/long

> -------------------------------------------------------------------------------------
>
>                 Key: SPARK-29316
>                 URL: https://issues.apache.org/jira/browse/SPARK-29316
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 2.1.0, 2.1.1, 2.2.0, 2.3.0
>            Reporter: Ambar Raghuvanshi
>            Priority: Major
>              Labels: csv, csvparser, easy-fix, inference, ramp-up, schema
>
> It would be great to have an option in Spark's schema inference to *not* to convert to
int/long datatype a column that has leading zeros. Think zip codes, for example.
> {code}
> df = (sqlc.read.format('csv')
>               .option('inferSchema', True)
>               .option('header', True)
>               .option('delimiter', '|')
>               .option('leadingZeros', 'KEEP')       # this is the new proposed option
>               .option('mode', 'FAILFAST')
>               .load('csvfile_withzipcodes_to_ingest.csv')
>             )
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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


Mime
View raw message