query::range_select::plan_rewrite

Function parse_align_to

source
fn parse_align_to(
    args: &[Expr],
    i: usize,
    timezone: Option<&Timezone>,
) -> Result<i64>
Expand description

Parse the align to clause and return a UTC timestamp with unit of millisecond, which is used as the basis for dividing time slot during the align operation.

  1. NOW: align to current execute time
  2. Timestamp string: align to specific timestamp
  3. An expr can be evaluated at the logical plan stage (e.g. now() - INTERVAL '1' day)
  4. leave empty (as Default Option): align to unix epoch 0 (timezone aware)