96a3533de8
### What changes were proposed in this pull request? Extend `HiveResult.toHiveString()` to support new interval types `YearMonthIntervalType` and `DayTimeIntervalType`. ### Why are the changes needed? To fix failures while formatting ANSI intervals as Hive strings. For example: ```sql spark-sql> select timestamp'now' - date'2021-01-01'; 21/04/08 09:42:49 ERROR SparkSQLDriver: Failed in [select timestamp'now' - date'2021-01-01'] scala.MatchError: (PT2337H42M46.649S,DayTimeIntervalType) (of class scala.Tuple2) at org.apache.spark.sql.execution.HiveResult$.toHiveString(HiveResult.scala:97) ``` ### Does this PR introduce _any_ user-facing change? Yes. After the changes: ```sql spark-sql> select timestamp'now' - date'2021-01-01'; INTERVAL '97 09:37:52.171' DAY TO SECOND ``` ### How was this patch tested? By running new tests: ``` $ build/sbt -Phive-2.3 -Phive-thriftserver "testOnly *HiveResultSuite" ``` Closes #32087 from MaxGekk/ansi-interval-hiveResultString. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> |
||
---|---|---|
.. | ||
benchmarks | ||
src | ||
pom.xml |