Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed May 2, 2024
1 parent 0c8da56 commit 22c6394
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,22 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde {
castSupport match {
case Compatible =>
castToProto(timeZoneId, dt, childExpr, evalModeStr)
case Incompatible(reason) if CometConf.COMET_CAST_ALLOW_INCOMPATIBLE.get() =>
logWarning(s"Calling incompatible CAST expression: $cast" +
reason.map(str => s" ($str)").getOrElse(""))
castToProto(timeZoneId, dt, childExpr, evalModeStr)
case Incompatible(reason) =>
if (CometConf.COMET_CAST_ALLOW_INCOMPATIBLE.get()){
logWarning(s"Calling incompatible CAST expression: $cast" +
reason.map(str => s" ($str)").getOrElse(""))
castToProto(timeZoneId, dt, childExpr, evalModeStr)
} else {
withInfo(
expr,
s"Comet does not guarantee correct results for cast " +
s"from ${child.dataType} to $dt " +
s"with timezone $timeZoneId and evalMode $evalModeStr" +
reason.map(str => s" ($str)").getOrElse("") + "." +
s"To enable all incompatible casts, set " +
s"${CometConf.COMET_CAST_ALLOW_INCOMPATIBLE.key}=true"
)
}
case Unsupported(reason) =>
withInfo(
expr,
Expand Down

0 comments on commit 22c6394

Please sign in to comment.