Skip to content
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

Some of FilteringSpec tests fail when run locally #288

Closed
flipp5b opened this issue Jan 18, 2023 · 4 comments · Fixed by #290
Closed

Some of FilteringSpec tests fail when run locally #288

flipp5b opened this issue Jan 18, 2023 · 4 comments · Fixed by #290

Comments

@flipp5b
Copy link
Contributor

flipp5b commented Jan 18, 2023

When I run integration tests locally using sbt core/IntegrationTest/test, a few tests inside the com.github.mjakubowski84.parquet4s.FilteringSpec fail:

[info] - should filter data by dateTime INT64 millis *** FAILED ***
[info]   1900-01-01T00:04:25 was not equal to 1900-01-01T00:34:08 (FilteringSpec.scala:118)
14:05:02.476 [pool-1-thread-1-ScalaTest-running-FilteringSpec] DEBUG c.g.m.parquet4s.ParquetReader$ - Creating ParquetIterable for path file:/tmp/example6726383439604235956/micros.parquet
14:05:02.564 [pool-1-thread-1-ScalaTest-running-FilteringSpec] DEBUG c.g.m.parquet4s.ParquetReader$ - Creating ParquetIterable for path file:/tmp/example6726383439604235956/micros.parquet
14:05:02.640 [pool-1-thread-1-ScalaTest-running-FilteringSpec] DEBUG c.g.m.parquet4s.ParquetReader$ - Creating ParquetIterable for path file:/tmp/example6726383439604235956/micros.parquet
[info] - should filter data by dateTime INT64 micros *** FAILED ***
[info]   1900-01-01T00:04:25 was not equal to 1900-01-01T00:34:08 (FilteringSpec.scala:118)
14:05:02.702 [pool-1-thread-1-ScalaTest-running-FilteringSpec] DEBUG c.g.m.parquet4s.ParquetReader$ - Creating ParquetIterable for path file:/tmp/example3995348077930743729/nanos.parquet
14:05:02.753 [pool-1-thread-1-ScalaTest-running-FilteringSpec] DEBUG c.g.m.parquet4s.ParquetReader$ - Creating ParquetIterable for path file:/tmp/example3995348077930743729/nanos.parquet
14:05:02.804 [pool-1-thread-1-ScalaTest-running-FilteringSpec] DEBUG c.g.m.parquet4s.ParquetReader$ - Creating ParquetIterable for path file:/tmp/example3995348077930743729/nanos.parquet
[info] - should filter data by dateTime INT64 nanos *** FAILED ***
[info]   1900-01-01T00:04:25 was not equal to 1900-01-01T00:34:08 (FilteringSpec.scala:118)

If I run sbt with TZ environment variable set (TZ=UTC sbt core/IntegrationTest/test), everything works fine.

@flipp5b
Copy link
Contributor Author

flipp5b commented Jan 18, 2023

It looks like the issue only manifests for some time zones.

  • TZ=Europe/London sbt "core/IntegrationTest/testOnly -z com.github.mjakubowski84.parquet4s.FilteringSpec" - Success.
  • TZ=Europe/Berlin sbt "core/IntegrationTest/testOnly -z com.github.mjakubowski84.parquet4s.FilteringSpec" - Success.
  • TZ=Europe/Warsaw sbt "core/IntegrationTest/testOnly -z com.github.mjakubowski84.parquet4s.FilteringSpec" - Failure (1900-01-01T00:58:08 was not equal to 1900-01-01T00:34:08).
  • TZ=Europe/Moscow sbt "core/IntegrationTest/testOnly -z com.github.mjakubowski84.parquet4s.FilteringSpec" - Failure (1900-01-01T00:04:25 was not equal to 1900-01-01T00:34:08).

@marcinaylien
Copy link
Collaborator

Ha!
Europe/Warsaw is treated by JVM (?) as the timezone used in Polish Commonwealth several hundred years ago :D

@mjakubowski84
Copy link
Owner

mjakubowski84 commented Jan 18, 2023

So, it is actually a bug in Java: https://stackoverflow.com/questions/47823081/java-sql-timestamp-wrong-time-parsing
In order to fix, one must avoid using Timestamp.valueOf or similar

@flipp5b
Copy link
Contributor Author

flipp5b commented Jan 18, 2023

Well, yeah :) Switching zeroDate to a more recent date (like LocalDate.of(2000, 1, 1)) works for all the time zones above.

@mjakubowski84 mjakubowski84 linked a pull request Jan 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants