[ https://issues.apache.org/jira/browse/SPARK-31474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17088820#comment-17088820 ]
Wenchen Fan commented on SPARK-31474: ------------------------------------- Thanks for catching! I've pushed to fix to branch-3.0. > Consistancy between dayofweek/dow in extract expression and dayofweek function > ------------------------------------------------------------------------------ > > Key: SPARK-31474 > URL: https://issues.apache.org/jira/browse/SPARK-31474 > Project: Spark > Issue Type: Improvement > Components: SQL > Affects Versions: 3.0.0 > Reporter: Kent Yao > Assignee: Kent Yao > Priority: Major > Fix For: 3.0.0 > > > {code:sql} > spark-sql> SELECT extract(dayofweek from '2009-07-26'); > 1 > spark-sql> SELECT extract(dow from '2009-07-26'); > 0 > spark-sql> SELECT extract(isodow from '2009-07-26'); > 7 > spark-sql> SELECT dayofweek('2009-07-26'); > 1 > spark-sql> SELECT weekday('2009-07-26'); > 6 > {code} > Currently, there are 4 types of day-of-week range: > the function dayofweek(2.3.0) and extracting dayofweek(2.4.0) result as of > Sunday(1) to Saturday(7) > extracting dow(3.0.0) results as of Sunday(0) to Saturday(6) > extracting isodow (3.0.0) results as of Monday(1) to Sunday(7) > the function weekday(2.4.0) results as of Monday(0) to Sunday(6) > Actually, extracting dayofweek and dow are both derived from PostgreSQL but > have different meanings. > https://issues.apache.org/jira/browse/SPARK-23903 > https://issues.apache.org/jira/browse/SPARK-28623 -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org