mish15
mish15

Reputation: 55

Why does CURRENT_DATE() cause queries to not be cached?

Unlike other time functions, this returns the same answer for 24 hours so it seems strange it prevents query caching. Is this a bug or expected behaviour?

I want to save a view with a fixed rolling date window on a date partitioned table (yesterday to 8 days ago), but this isn't possible if I need to construct the date outside of bigquery to ensure caching.

Upvotes: 3

Views: 394

Answers (1)

Elliott Brossard
Elliott Brossard

Reputation: 33745

It's to avoid having special caching logic for different functions. You could submit a feature request on the issue tracker, but I suspect that it wouldn't be a high priority relative to other issues.

Upvotes: 2

Related Questions