diff --git a/datafusion/sql/src/unparser/dialect.rs b/datafusion/sql/src/unparser/dialect.rs
index d8a4fb254264..32d03032e028 100644
--- a/datafusion/sql/src/unparser/dialect.rs
+++ b/datafusion/sql/src/unparser/dialect.rs
@@ -18,12 +18,17 @@
use std::sync::Arc;
use arrow_schema::TimeUnit;
+use datafusion_expr::Expr;
use regex::Regex;
use sqlparser::{
- ast::{self, Ident, ObjectName, TimezoneInfo},
+ ast::{self, Function, Ident, ObjectName, TimezoneInfo},
keywords::ALL_KEYWORDS,
};
+use datafusion_common::Result;
+
+use super::{utils::date_part_to_sql, Unparser};
+
/// `Dialect` to use for Unparsing
///
/// The default dialect tries to avoid quoting identifiers unless necessary (e.g. `a` instead of `"a"`)
@@ -108,6 +113,15 @@ pub trait Dialect: Send + Sync {
fn supports_column_alias_in_table_alias(&self) -> bool {
true
}
+
+ fn scalar_function_to_sql_overrides(
+ &self,
+ _unparser: &Unparser,
+ _func_name: &str,
+ _args: &[Expr],
+ ) -> Result