MCPcopy Create free account
hub / github.com/apache/datafusion / simplify

Method simplify

datafusion/functions/src/datetime/now.rs:131–147  ·  view source on GitHub ↗
(
        &self,
        args: Vec<Expr>,
        info: &SimplifyContext,
    )

Source from the content-addressed store, hash-verified

129 }
130
131 fn simplify(
132 &self,
133 args: Vec<Expr>,
134 info: &SimplifyContext,
135 ) -> Result<ExprSimplifyResult> {
136 let Some(now_ts) = info.query_execution_start_time() else {
137 return Ok(ExprSimplifyResult::Original(args));
138 };
139
140 Ok(ExprSimplifyResult::Simplified(Expr::Literal(
141 ScalarValue::TimestampNanosecond(
142 now_ts.timestamp_nanos_opt(),
143 self.timezone.clone(),
144 ),
145 None,
146 )))
147 }
148
149 fn aliases(&self) -> &[String] {
150 &self.aliases

Callers

nothing calls this directly

Calls 3

LiteralInterface · 0.50
cloneMethod · 0.45

Tested by

no test coverage detected