[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-19 Thread 10110346
Github user 10110346 commented on the issue: https://github.com/apache/spark/pull/17997 OK,l Will do it, thanks. @gatorsmile --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-19 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/17997 Could you submit a backport PR to 2.1? Thanks! --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-19 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/17997 Thanks! Merging to master/2.2. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-19 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/17997 After checking DB2, it behaves the same as MySQL. LGTM --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-19 Thread 10110346
Github user 10110346 commented on the issue: https://github.com/apache/spark/pull/17997 @gatorsmile I have tested like this: `val dav = Date.valueOf("1582-10-04"); val date = new Date(dav.getTime); println(date.toString)` the output is :1582-10-04 `val dav

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-18 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/17997 The current impl is still missing the special handling of that miracle period. See the outputs of Oracle: ``` Result Set 34 TO_CHAR(TO_DATE('1582-10-04','-MM-DD'),'DDD') 277

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-18 Thread ueshin
Github user ueshin commented on the issue: https://github.com/apache/spark/pull/17997 ok to test --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-16 Thread 10110346
Github user 10110346 commented on the issue: https://github.com/apache/spark/pull/17997 @ueshin Yes, I will do it ,thanks --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-16 Thread ueshin
Github user ueshin commented on the issue: https://github.com/apache/spark/pull/17997 I guess this would also affect date-related functions such as `dayofyear`, `year`, `quater` and `weekofyear`, etc. Could you add tests for them? --- If your project is set up for it, you can

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-16 Thread 10110346
Github user 10110346 commented on the issue: https://github.com/apache/spark/pull/17997 @srowen @rxin So, by contrast, mybe make a hack in one place is a better solution --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well.

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-16 Thread AmplabJenkins
Github user AmplabJenkins commented on the issue: https://github.com/apache/spark/pull/17997 Can one of the admins verify this patch? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-16 Thread 10110346
Github user 10110346 commented on the issue: https://github.com/apache/spark/pull/17997 I have tried to changed `getYearAndDayInYear` like this: `private[this] def getYearAndDayInYear(daysSince1970: SQLDate): (Int, Int, Int) = { val date = new

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-16 Thread 10110346
Github user 10110346 commented on the issue: https://github.com/apache/spark/pull/17997 @srowen I have tested in mysql, it can support dates before 1970. mysql> select month("1582-09-28"); +-+ | month("1582-09-28") | +-+ |

[GitHub] spark issue #17997: [SPARK-20763][SQL]The function of `month` and `day` retu...

2017-05-16 Thread srowen
Github user srowen commented on the issue: https://github.com/apache/spark/pull/17997 Point taken, but do other DBs support dates before 1970? it does highly depend on historical calendars. The right solution isn't a hack in one place here but using Calendar properly, if anything.