diff --git a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/datetimeExpressions.scala b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/datetimeExpressions.scala index 0f382a7b6e6..d08c598cba4 100644 --- a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/datetimeExpressions.scala +++ b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/datetimeExpressions.scala @@ -707,7 +707,9 @@ object GpuToTimestamp { case _ => // this is the incompatibleDateFormats case where we do not guarantee compatibility with // Spark and assume that all non-null inputs are valid - ColumnVector.fromScalar(Scalar.fromBool(true), col.getRowCount.toInt) + withResource(Scalar.fromBool(true)) { s => + ColumnVector.fromScalar(s, col.getRowCount.toInt) + } } }