use FROM_UNIXTIME() for earliest and latest condition date conversion - #359
Open
elliVM wants to merge 3 commits into
Open
use FROM_UNIXTIME() for earliest and latest condition date conversion#359elliVM wants to merge 3 commits into
elliVM wants to merge 3 commits into
Conversation
elliVM
commented
Jul 16, 2026
| + " and \"journaldb\".\"logfile\".\"logdate\" <= date '2024-10-20'\n" | ||
| + " and (UNIX_TIMESTAMP(STR_TO_DATE(SUBSTRING(REGEXP_SUBSTR(path,'[0-9]+(\\.rfc5424)?(\\.log)?\\.gz(\\.[0-9]*)?$'), 1, 10), '%Y%m%d%H')) <= 1729435021)\n" | ||
| + ")"; | ||
| // spotless:off |
Contributor
Author
There was a problem hiding this comment.
Test is easier to read without spotless formatting.
Change:
date '2022-01-26' -> DATE(FROM_UNIXTIME(1643205600))
date '2024-10-20' -> DATE(FROM_UNIXTIME(1729435021))
elliVM
commented
Jul 16, 2026
| + " ),\n" + " \"bloomdb\".\"pattern_test_ip\".\"filter\"\n" + " ) = true\n" | ||
| + " and \"bloomdb\".\"pattern_test_ip\".\"filter\" is not null\n" + " )\n" | ||
| + " or \"bloomdb\".\"pattern_test_ip\".\"filter\" is null\n" + " )\n" + ")"; | ||
| // spotless:off |
Contributor
Author
There was a problem hiding this comment.
Change:
date '2022-01-26' -> DATE(FROM_UNIXTIME(1643205600))
date '2024-10-20' -> DATE(FROM_UNIXTIME(1729435021))
Tiihott
requested changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolves #355
Use MariaDB's
FROM_UNIXTIME()function to calculate dates inEarliestConditionandLatestCondition.Previously, epoch values were converted to
java.sql.Datein the JVM timezone before being used in the SQL condition. This caused the generated logdate condition to depend on the JVM timezone, while the logtime condition depended on the MariaDB session timezone.By moving the epoch-to-date conversion to MariaDB, both conditions now use the MariaDB session timezone consistently.
This affects existing tests containing earliest or latest conditions because the generated SQL now uses
DATE(FROM_UNIXTIME(...))instead of a date literal.Note: MariaDB documentation recommends using a named timezone (for example
UTCorEurope/Helsinki) instead of offsets to avoid timezone-related performance issues.FROM_UNIXTIME() documentation
Testing
General
Assertions
Testing Data
Statements
Java
Other
Code Quality