Uh oh!
There was an error while loading. Please reload this page.
[SPARK-25517][SQL] Detect/Infer date type in CSV file - #22539
[SPARK-25517][SQL] Detect/Infer date type in CSV file#22539TheCodeCache wants to merge 1 commit into
Conversation
This fix is with reference to the below JIRA Issue which I've created just hours before: https://issues.apache.org/jira/browse/SPARK-25517 This is about spark.read.format("csv").option("inferSchema", "true").option("dateFormat", "MM/dd/yyyy").load(/path/to/csvfile). Assume /path/to/csvfile has date type column such as employee joining date, for example:- 02/22/2018 which is 22nd of feb 2018 is a date but the spark always read this joining_date column as string, whereas this works perfectly fine with timestampFormat.
TheCodeCache
commented
Sep 24, 2018
Hi, Please review the changes for the bug which is described and documented here at the below JIRA location in detail: https://issues.apache.org/jira/browse/SPARK-25517 Thanks, |
AmplabJenkins
commented
Sep 24, 2018
Can one of the admins verify this patch? |
Could you edit your title to include the jira number and component? e.g. [SPARK-25517][CORE] Detect ... Helps with bookkeeping, plus it'll add a link to the jira so people can see your PR from there. |
There was a problem hiding this comment.
Hi, @softmanu .
- Since this PR changes
tryParseTimestamp, it seems to be not a good place for this logic. Do you want to add a new function or to rename this function? - Could you add your test case (from SPARK-25517) at
CSVInferSchemaSuite.scala?
BTW, #11550 originally aimed to DateType, too. So, cc @HyukjinKwon .
For TimestampType, this uses the given format to infer schema and also to convert the values
For DateType, this uses the given format to convert the values.
HyukjinKwon
commented
Sep 25, 2018
I think this is a duplicate of #21363 |
dongjoon-hyun
commented
Sep 25, 2018
Thank you for review, @HyukjinKwon . @softmanu . Could you take a look at SPARK-19228 and close this PR and Apache Spark JIRA? |
dongjoon-hyun
commented
Sep 27, 2018
Ping, @softmanu . |
TheCodeCache
commented
Sep 30, 2018
@dongjoon-hyun@HyukjinKwon And sure, I will add a test case, and work upon it. P.S. I've found other different issues in spark same around date/timestamp which is not working at all because the implementation itself is missing totally. On this I will get back later, first let me resolve this current issue. Thanks, |
HyukjinKwon
commented
Oct 1, 2018
Looks #21363 getting inactive. Can you take this over instead? You can pick up the commits there and open another PR. |
Closesapache#21766Closesapache#21679Closesapache#21161Closesapache#20846Closesapache#19434Closesapache#18080Closesapache#17648Closesapache#17169 Add: Closesapache#22813Closesapache#21994Closesapache#22005Closesapache#22463 Add: Closesapache#15899 Add: Closesapache#22539Closesapache#21868Closesapache#21514Closesapache#21402Closesapache#21322Closesapache#21257Closesapache#20163Closesapache#19691Closesapache#18697Closesapache#18636Closesapache#17176Closesapache#23001 from wangyum/CloseStalePRs. Authored-by: Yuming Wang <yumwang@ebay.com> Signed-off-by: hyukjinkwon <gurwls223@apache.org>
This fix is with reference to the below JIRA Issue which I've created just hours before:
SPARK-25517
This is about spark.read.format("csv").option("inferSchema", "true").option("dateFormat", "MM/dd/yyyy").load(/path/to/csvfile). Assume /path/to/csvfile has a column which contains just date information such as employee joining date, for example:- 02/22/2018 which is 22nd of feb 2018, is a date but the spark always incorrectly reads this joining_date column as string, whereas the same analogy works perfectly fine with timestampFormat or the timestamp column values in csv.
What changes were proposed in this pull request?
to support for detecting date type from the csv files,
How was this patch tested?
manual test
Please review http://spark.apache.org/contributing.html before opening a pull request.