16d223efee
### What changes were proposed in this pull request? In this PR, we add extract/date_part support for ANSI Intervals The `extract` is an ANSI expression and `date_part` is NON-ANSI but exists as an equivalence for `extract` #### expression ``` <extract expression> ::= EXTRACT <left paren> <extract field> FROM <extract source> <right paren> ``` #### <extract field> for interval source ``` <primary datetime field> ::= <non-second primary datetime field> | SECOND <non-second primary datetime field> ::= YEAR | MONTH | DAY | HOUR | MINUTE ``` #### dataType ``` If <extract field> is a <primary datetime field> that does not specify SECOND or <extract field> is not a <primary datetime field>, then the declared type of the result is an implementation-defined exact numeric type with scale 0 (zero) Otherwise, the declared type of the result is an implementation-defined exact numeric type with scale not less than the specified or implied <time fractional seconds precision> or <interval fractional seconds precision>, as appropriate, of the SECOND <primary datetime field> of the <extract source>. ``` ### Why are the changes needed? Subtask of ANSI Intervals Support ### Does this PR introduce _any_ user-facing change? Yes 1. extract/date_part support ANSI intervals 2. for non-ansi intervals, the return type is changed from long to byte when extracting hours ### How was this patch tested? new added tests Closes #32351 from yaooqinn/SPARK-35091. Authored-by: Kent Yao <yao@apache.org> Signed-off-by: Wenchen Fan <wenchen@databricks.com> |
||
---|---|---|
.. | ||
benchmarks | ||
src | ||
pom.xml |