spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viirya <...@git.apache.org>
Subject [GitHub] spark pull request #21582: [SPARK-24576][BUILD] Upgrade Apache ORC to 1.5.1
Date Mon, 18 Jun 2018 00:04:55 GMT
Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21582#discussion_r195945963
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala
---
    @@ -59,6 +59,19 @@ private[sql] object OrcFileFormat {
       def checkFieldNames(names: Seq[String]): Unit = {
         names.foreach(checkFieldName)
       }
    +
    +  def getQuotedSchemaString(dataType: DataType): String = dataType match {
    +    case _: AtomicType => dataType.catalogString
    +    case StructType(fields) =>
    +      fields.map(f => s"`${f.name}`:${getQuotedSchemaString(f.dataType)}")
    +        .mkString("struct<", ",", ">")
    +    case ArrayType(elementType, _) =>
    +      s"array<${getQuotedSchemaString(elementType)}>"
    +    case MapType(keyType, valueType, _) =>
    +      s"map<${getQuotedSchemaString(keyType)},${getQuotedSchemaString(valueType)}>"
    +    case _ => // UDT and others
    --- End diff --
    
    nit: Seems the first `_: AtomicType` can be saved because this covers all other cases?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message