sunchao commented on a change in pull request #34659:
URL: https://github.com/apache/spark/pull/34659#discussion_r826425700
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetUtils.scala
##########
@@ -187,6 +188,30 @@ object ParquetUtils {
}
}
+ /**
+ * Whether columnar read is supported for the input `schema`.
+ */
+ def isBatchReadSupportedForSchema(sqlConf: SQLConf, schema: StructType):
Boolean =
+ sqlConf.parquetVectorizedReaderEnabled &&
+ schema.forall(f => isBatchReadSupported(sqlConf, f.dataType))
+
+ def isBatchReadSupported(sqlConf: SQLConf, dt: DataType): Boolean = dt match
{
+ case _: AtomicType =>
+ true
+ case at: ArrayType =>
+ sqlConf.parquetVectorizedReaderNestedColumnEnabled &&
+ isBatchReadSupported(sqlConf, at.elementType)
+ case mt: MapType =>
+ sqlConf.parquetVectorizedReaderNestedColumnEnabled &&
+ isBatchReadSupported(sqlConf, mt.keyType) &&
+ isBatchReadSupported(sqlConf, mt.valueType)
+ case st: StructType =>
Review comment:
I'm not sure if we even support reading & writing of
`CalendarIntervalType` in Parquet at the moment - it seems we don't from
looking at `ParquetWriteSupport.makeWriter`. IIUC it is also going to be
deprecated by `YearMonthIntervalType` and `DayTimeIntervalType`, is that
correct @MaxGekk ?
--
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]