-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration tests failing for non-utc timestamp in date_test.py #11539
Comments
Reproduce
CPU: -2311528634 The diff is one second. AnalysisTest Spark 330 shellscala> import java.time._
import java.time._
scala> import org.apache.spark.sql.catalyst.util.DateTimeUtils
import org.apache.spark.sql.catalyst.util.DateTimeUtils
scala> val epochSeconds = LocalDateTime.of(1896,10,1,0,0,0).toInstant(ZoneOffset.UTC).getEpochSecond()
epochSeconds: Long = -2311545600
scala> val micros = epochSeconds * 1000000
micros: Long = -2311545600000000
scala> val expected = DateTimeUtils.convertTz(micros, ZoneId.of("America/Punta_Arenas"), ZoneId.of("UTC"))/1000000L
expected: Long = -2311528635 // this is the same with GPU output test non-LEACY modeSave the following line into a parquet
conclusionThis is a corner case in TODODebug into Spark to see what happened in |
Spark has different behavior between LEGACY and non-LEGACY mode: Spark330: scala> spark.conf.set("spark.sql.session.timeZone", "America/Punta_Arenas")
scala> spark.conf.set("spark.sql.legacy.timeParserPolicy", "CORRECTED")
scala> spark.sql("select unix_timestamp('18961001', 'yyyyMMdd')").show()
+----------------------------------+
|unix_timestamp(18961001, yyyyMMdd)|
+----------------------------------+
| -2311528635|
+----------------------------------+
scala> spark.conf.set("spark.sql.legacy.timeParserPolicy", "LEGACY")
scala> spark.sql("select unix_timestamp('18961001', 'yyyyMMdd')").show()
+----------------------------------+
|unix_timestamp(18961001, yyyyMMdd)|
+----------------------------------+
| -2311535143|
+----------------------------------+
|
We already documented that
|
Below nightly integration tests are failing:
Additional info of failing tests:
The text was updated successfully, but these errors were encountered: