[
https://issues.apache.org/jira/browse/SPARK-34953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17345680#comment-17345680
]
Tomas Hudik commented on SPARK-34953:
-------------------------------------
Hi [~saurabhc100] , thanks for PR.
"when there are multiple columns" - i think this is general problem not related
to the number of columns (it can be 1, 2 10,...). The problem is that there is
no way how to create a schema for `date` type
> 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: [email protected]
For additional commands, e-mail: [email protected]