hsiang-c commented on code in PR #3242:
URL: https://github.com/apache/datafusion-comet/pull/3242#discussion_r2718351928
##########
spark/src/main/scala/org/apache/comet/parquet/ParquetFilters.scala:
##########
@@ -885,10 +887,12 @@ class ParquetFilters(
def createNativeFilters(predicates: Seq[sources.Filter]):
Option[Array[Byte]] = {
predicates.reduceOption(sources.And).flatMap(createNativeFilter).map {
expr =>
- val outputStream = new ByteArrayOutputStream()
- expr.writeTo(outputStream)
- outputStream.close()
- outputStream.toByteArray
+ val size = expr.getSerializedSize
+ val bytes = new Array[Byte](size)
Review Comment:
size of `Int` type, so I think we're safe here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]