Skip to content

Commit

Permalink
fix test regression
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Apr 20, 2024
1 parent cc1905a commit 7bbdf00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions core/src/execution/datafusion/expressions/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ impl Display for Cast {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
f,
"Cast [data_type: {}, timezone: {}, child: {}]",
self.data_type, self.timezone, self.child
"Cast [data_type: {}, timezone: {}, child: {}, eval_mode: {:?}]",
self.data_type, self.timezone, self.child, &self.eval_mode
)
}
}
Expand All @@ -160,6 +160,7 @@ impl PartialEq<dyn Any> for Cast {
self.child.eq(&x.child)
&& self.timezone.eq(&x.timezone)
&& self.data_type.eq(&x.data_type)
&& self.eval_mode.eq(&x.eval_mode)
})
.unwrap_or(false)
}
Expand Down Expand Up @@ -217,6 +218,7 @@ impl PhysicalExpr for Cast {
self.child.hash(&mut s);
self.data_type.hash(&mut s);
self.timezone.hash(&mut s);
self.eval_mode.hash(&mut s);
self.hash(&mut s);
}
}
2 changes: 1 addition & 1 deletion core/src/execution/datafusion/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ impl PhysicalPlanner {
"LEGACY" => EvalMode::Legacy,
other => {
return Err(ExecutionError::GeneralError(format!(
"Invalid Cast EvalMode: {other}"
"Invalid Cast EvalMode: \"{other}\""
)))
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde {
.newBuilder()
.setChild(e)
.setDatatype(serializeDataType(IntegerType).get)
.setEvalMode("LEGACY") // year is not affected by ANSI mode
.build())
.build()
})
Expand Down

0 comments on commit 7bbdf00

Please sign in to comment.