Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datafusion/core/src/optimizer/simplify_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ mod tests {
// expect the same timestamp appears in both exprs
let actual = get_optimized_plan_formatted(&plan, &time);
let expected = format!(
"Projection: TimestampNanosecond({}, Some(\"UTC\")) AS now(), TimestampNanosecond({}, Some(\"UTC\")) AS t2\
"Projection: TimestampNanosecond({}, Some(\"UTC\")) AS now, TimestampNanosecond({}, Some(\"UTC\")) AS t2\
\n TableScan: test projection=None",
time.timestamp_nanos(),
time.timestamp_nanos()
Expand Down Expand Up @@ -1910,7 +1910,7 @@ mod tests {

// Note that constant folder runs and folds the entire
// expression down to a single constant (true)
let expected = "Filter: Boolean(true) AS CAST(now() AS Int64) < CAST(totimestamp(Utf8(\"2020-09-08T12:05:00+00:00\")) AS Int64) + Int32(50000)\
let expected = "Filter: Boolean(true) AS CAST(now AS Int64) < CAST(totimestamp(Utf8(\"2020-09-08T12:05:00+00:00\")) AS Int64) + Int32(50000)\
\n TableScan: test projection=None";
let actual = get_optimized_plan_formatted(&plan, &time);

Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/tests/sql/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ async fn pi_function() -> Result<()> {
let actual = execute_to_batches(&ctx, sql).await;
let expected = vec![
"+-------------------+--------------------+--------------------+",
"| pi() | pi() / Int64(2) | pi() / Int64(3) |",
"| pi | pi / Int64(2) | pi / Int64(3) |",
"+-------------------+--------------------+--------------------+",
"| 3.141592653589793 | 1.5707963267948966 | 1.0471975511965976 |",
"+-------------------+--------------------+--------------------+",
Expand Down
3 changes: 3 additions & 0 deletions datafusion/expr/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,9 @@ fn create_function_name(
args: &[Expr],
input_schema: &DFSchema,
) -> Result<String> {
if !distinct && args.is_empty() {
return Ok(fun.to_ascii_lowercase());
}
let names: Vec<String> = args
.iter()
.map(|e| create_name(e, input_schema))
Expand Down
Loading