thomasdesr opened a new pull request #18690: URL: https://github.com/apache/superset/pull/18690
### SUMMARY Spark removed date format string 'u' in Spark 3.0 [[0]] so the grain expressions need to be updated because ones that depend on that format string are failing :( I switched the behavior to use `date_trunc` which has been around since 2.3 [[1]] based on how the Athena db engine spec handles this [[2]]. I think its probably fine to raise the minimum supported version to 2.3 because this is a "Databricks" db_engine_spec and Databricks hasn't publicly supported something that old since ~Jan 2020 [[3]]. [0]: https://issues.apache.org/jira/browse/SPARK-31892 (is the best reference I can find) [1]: https://spark.apache.org/docs/latest/api/sql/index.html#date_trunc [2]: https://github.com/apache/superset/blob/master/superset/db_engine_specs/athena.py#L38-L50 [3]: https://docs.databricks.com/release-notes/runtime/releases.html ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF I can't reproduce the old behavior (I don't have that old a spark cluster xD) but here's a table of timestamps from a current version of spark run through these same expressions: | **_timestamp** | 2021-02-08T23:58:02 | 2021-02-08T23:58:41 | 2021-02-08T23:59:31 | | - | - | - | - | | **PT1S** | 2021-02-08T23:58:02 | 2021-02-08T23:58:41 | 2021-02-08T23:59:31 | | **PT1M** | 2021-02-08T23:58:00 | 2021-02-08T23:58:00 | 2021-02-08T23:59:00 | | **PT1H** | 2021-02-08T23:00:00 | 2021-02-08T23:00:00 | 2021-02-08T23:00:00 | | **P1D** | 2021-02-08T00:00:00 | 2021-02-08T00:00:00 | 2021-02-08T00:00:00 | | **P1W** | 2021-02-08T00:00:00 | 2021-02-08T00:00:00 | 2021-02-08T00:00:00 | | **P1M** | 2021-02-01T00:00:00 | 2021-02-01T00:00:00 | 2021-02-01T00:00:00 | | **P3M** | 2021-01-01T00:00:00 | 2021-01-01T00:00:00 | 2021-01-01T00:00:00 | | **P1Y** | 2021-01-01T00:00:00 | 2021-01-01T00:00:00 | 2021-01-01T00:00:00 | | **P1W/1970-01-03T00:00:00Z** | 2021-02-13T00:00:00 | 2021-02-13T00:00:00 | 2021-02-13T00:00:00 | | **1969-12-28T00:00:00Z/P1W** | 2021-02-07T00:00:00 | 2021-02-07T00:00:00 | 2021-02-07T00:00:00 | ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
