[Bug] Invalid where filter for latest batch when event_column
is of type date
#10868
Labels
Milestone
event_column
is of type date
#10868
Currently, when running a microbatch model, the current time is right now. This, for the most part, just works. However, there is a problem.
Sometimes the
event_time
column is adate
instead of adatetime
. Now consider a model where theevent_time
isdate_added
which is adate
type. The microbatch filter would then be something likedate_added >= ‘2024-10-16 00:00:00’ and date_added < ‘2024-10-16 11:29:34’
. Now, how does the data warehouse handle that? In some cases the datetime value gets auto truncated to a date, thus making the filterdate_added >= ‘2024-10-16’ and date_added < ‘2024-10-16’
. That is problematic because that filter will always return zero rows. To get around this, one solution could be to take the batch ceiling of the current time. That is, if ourbatch_size
isday
then2024-10-16 11:29:34
would become2024-10-17 00:00:00
, and then upon truncation2024-10-17
.The text was updated successfully, but these errors were encountered: