cloud-fan commented on a change in pull request #29457:
URL: https://github.com/apache/spark/pull/29457#discussion_r473814604
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFiltersBase.scala
##########
@@ -49,19 +51,21 @@ trait OrcFiltersBase {
*/
protected[sql] def getSearchableTypeMap(
schema: StructType,
- caseSensitive: Boolean): Map[String, DataType] = {
+ caseSensitive: Boolean): Map[String, OrcPrimitiveField] = {
import
org.apache.spark.sql.connector.catalog.CatalogV2Implicits.MultipartIdentifierHelper
def getPrimitiveFields(
fields: Seq[StructField],
- parentFieldNames: Seq[String] = Seq.empty): Seq[(String, DataType)] = {
+ parentFieldNames: Seq[String] = Seq.empty): Seq[(String,
OrcPrimitiveField)] = {
fields.flatMap { f =>
f.dataType match {
case st: StructType =>
getPrimitiveFields(st.fields, parentFieldNames :+ f.name)
case BinaryType => None
case _: AtomicType =>
- Some(((parentFieldNames :+ f.name).quoted, f.dataType))
+ val fieldName = (parentFieldNames :+ f.name).quoted
+ val orcField = OrcPrimitiveField(fieldName, f.dataType)
+ Some((fieldName, orcField))
Review comment:
why do we need the `OrcPrimitiveField` if `fieldName` is always
`orcField.fieldName` 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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]