You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Saurabh Chawla (Jira)" <ji...@apache.org> on 2021/05/15 17:47:00 UTC

[jira] [Comment Edited] (SPARK-34953) inferSchema for type date

    [ https://issues.apache.org/jira/browse/SPARK-34953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17345099#comment-17345099 ] 

Saurabh Chawla edited comment on SPARK-34953 at 5/15/21, 5:46 PM:
------------------------------------------------------------------

This seems to the be the problem when there are multiple columns in the file which are of DateType and there is need to change it from StringType to DateType. 

[~xhudik]- Thanks for raising this Jira.

I have raised the PR for this change

https://github.com/apache/spark/pull/32558


was (Author: saurabhc100):
This seems to the be the problem when there are multiple columns in the file which are of DateType and there is need to change it from StringType to DateType. 

[~xhudik]- Thanks for raising this Jira.

I have raised the PR for this change

> inferSchema for type date 
> --------------------------
>
>                 Key: SPARK-34953
>                 URL: https://issues.apache.org/jira/browse/SPARK-34953
>             Project: Spark
>          Issue Type: New Feature
>          Components: Spark Core, SQL
>    Affects Versions: 3.1.1
>            Reporter: Tomas Hudik
>            Priority: Minor
>
> Reading a csv file with `option({color:#6a8759}"inferSchema"{color}{color:#cc7832},{color}{color:#6a8759}"true"{color})` doesnt work with `date` type.  E.g. [https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/CSVInferSchema.scala#L101:L119] - can process only `Timestamp` not a `Date`
>  
> Datasets often contain `Date` type therefore reading a file to Spark should be able to infer `Date` type to a column.
> For now, only work-arounds (e.g. [https://stackoverflow.com/a/46595057/1408096] , or [https://stackoverflow.com/questions/66935214/spark-reading-csv-with-specified-date-format] ) are possible/



--
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