Skip to content

Commit 88c75fc

Browse files
committed
Fix CI
1 parent 54ed6b7 commit 88c75fc

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

datafusion/sql/src/unparser/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2363,7 +2363,7 @@ mod tests {
23632363
expr: Box::new(col("a")),
23642364
data_type: DataType::Float64,
23652365
}),
2366-
Expr::Literal(ScalarValue::Int64(Some(2))),
2366+
Expr::from(ScalarValue::Int64(Some(2))),
23672367
],
23682368
});
23692369
let ast = unparser.expr_to_sql(&expr)?;

datafusion/sql/src/unparser/utils.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use datafusion_common::{
2323
Column, DataFusionError, Result, ScalarValue,
2424
};
2525
use datafusion_expr::{
26-
utils::grouping_set_to_exprlist, Aggregate, Expr, LogicalPlan, Window,
26+
utils::grouping_set_to_exprlist, Aggregate, Expr, LogicalPlan, Scalar, Window,
2727
};
2828
use sqlparser::ast;
2929

@@ -209,7 +209,11 @@ pub(crate) fn date_part_to_sql(
209209
match (style, date_part_args.len()) {
210210
(DateFieldExtractStyle::Extract, 2) => {
211211
let date_expr = unparser.expr_to_sql(&date_part_args[1])?;
212-
if let Expr::Literal(ScalarValue::Utf8(Some(field))) = &date_part_args[0] {
212+
if let Expr::Literal(Scalar {
213+
value: ScalarValue::Utf8(Some(field)),
214+
..
215+
}) = &date_part_args[0]
216+
{
213217
let field = match field.to_lowercase().as_str() {
214218
"year" => ast::DateTimeField::Year,
215219
"month" => ast::DateTimeField::Month,
@@ -230,7 +234,11 @@ pub(crate) fn date_part_to_sql(
230234
(DateFieldExtractStyle::Strftime, 2) => {
231235
let column = unparser.expr_to_sql(&date_part_args[1])?;
232236

233-
if let Expr::Literal(ScalarValue::Utf8(Some(field))) = &date_part_args[0] {
237+
if let Expr::Literal(Scalar {
238+
value: ScalarValue::Utf8(Some(field)),
239+
..
240+
}) = &date_part_args[0]
241+
{
234242
let field = match field.to_lowercase().as_str() {
235243
"year" => "%Y",
236244
"month" => "%m",

datafusion/substrait/src/logical_plan/producer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ mod test {
25392539
let ctx = SessionContext::new();
25402540

25412541
// One expression, empty input schema
2542-
let expr = Expr::Literal(ScalarValue::Int32(Some(42)));
2542+
let expr = Expr::from(ScalarValue::Int32(Some(42)));
25432543
let field = Field::new("out", DataType::Int32, false);
25442544
let empty_schema = DFSchemaRef::new(DFSchema::empty());
25452545
let substrait =

0 commit comments

Comments
 (0)