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

Function is_date_minus_date

datafusion/physical-expr/src/expressions/binary.rs:173–178  ·  view source on GitHub ↗

Returns true if both operands are Date types (Date32 or Date64) Used to detect Date - Date operations which should return Int64 (days difference)

(lhs: &DataType, rhs: &DataType)

Source from the content-addressed store, hash-verified

171/// Returns true if both operands are Date types (Date32 or Date64)
172/// Used to detect Date - Date operations which should return Int64 (days difference)
173fn is_date_minus_date(lhs: &DataType, rhs: &DataType) -> bool {
174 matches!(
175 (lhs, rhs),
176 (DataType::Date32, DataType::Date32) | (DataType::Date64, DataType::Date64)
177 )
178}
179
180/// Computes the difference between two dates and returns the result as Int64 (days)
181/// This aligns with PostgreSQL, DuckDB, and MySQL behavior where date - date returns an integer

Callers 1

evaluateMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…