Skip to content

Commit

Permalink
Fix merging error
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Mar 4, 2024
1 parent 5618148 commit ad90fcf
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1051,20 +1051,34 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde {
val dataType = serializeDataType(attr.dataType)

if (dataType.isDefined) {
val boundRef = BindReferences
.bindReference(attr, inputs, allowFailures = false)
.asInstanceOf[BoundReference]
val boundExpr = ExprOuterClass.BoundReference
.newBuilder()
.setIndex(boundRef.ordinal)
.setDatatype(dataType.get)
.build()
if (binding) {
val boundRef = BindReferences
.bindReference(attr, inputs, allowFailures = false)
.asInstanceOf[BoundReference]
val boundExpr = ExprOuterClass.BoundReference
.newBuilder()
.setIndex(boundRef.ordinal)
.setDatatype(dataType.get)
.build()

Some(
ExprOuterClass.Expr
Some(
ExprOuterClass.Expr
.newBuilder()
.setBound(boundExpr)
.build())
} else {
val unboundRef = ExprOuterClass.UnboundReference
.newBuilder()
.setBound(boundExpr)
.build())
.setName(attr.name)
.setDatatype(dataType.get)
.build()

Some(
ExprOuterClass.Expr
.newBuilder()
.setUnbound(unboundRef)
.build())
}
} else {
None
}
Expand Down

0 comments on commit ad90fcf

Please sign in to comment.