spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liancheng <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-2883][SQL] Spark Support for ORCFile wi...
Date Thu, 14 May 2015 04:59:26 GMT
Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6135#discussion_r30298129
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcRelation.scala ---
    @@ -0,0 +1,176 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.sql.hive.orc
    +
    +import java.util.Objects
    +
    +import org.apache.hadoop.fs.Path
    +import org.apache.hadoop.hive.ql.io.orc.{OrcSerde, OrcOutputFormat}
    +import org.apache.hadoop.hive.serde2.objectinspector.{ObjectInspector, StructObjectInspector}
    +import org.apache.hadoop.hive.serde2.typeinfo.{TypeInfoUtils, TypeInfo}
    +import org.apache.hadoop.io.{Writable, NullWritable}
    +import org.apache.hadoop.mapred.{RecordWriter, Reporter, JobConf}
    +import org.apache.hadoop.mapreduce.{TaskID, TaskAttemptContext}
    +import org.apache.spark.Logging
    +import org.apache.spark.annotation.DeveloperApi
    +import org.apache.spark.mapred.SparkHadoopMapRedUtil
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.catalyst.expressions.Attribute
    +import org.apache.spark.sql.hive.HiveMetastoreTypes
    +import org.apache.spark.sql.types.StructType
    +import org.apache.spark.sql.{Row, SQLContext}
    +import org.apache.spark.sql.sources._
    +import scala.collection.JavaConversions._
    +
    +
    +private[sql] class DefaultSource extends FSBasedRelationProvider {
    +
    +  def createRelation(
    +      sqlContext: SQLContext,
    +      paths: Array[String],
    +      schema: Option[StructType],
    +      partitionColumns: Option[StructType],
    +      parameters: Map[String, String]): FSBasedRelation ={
    +    val partitionSpec = partitionColumns.map(PartitionSpec(_, Seq.empty[Partition]))
    +    OrcRelation(paths, parameters,
    +      schema, partitionSpec)(sqlContext)
    +  }
    +}
    +
    +
    +private[sql] class OrcOutputWriter extends OutputWriter with SparkHadoopMapRedUtil {
    +  var recordWriter: RecordWriter[NullWritable, Writable] = _
    +  var taskAttemptContext: TaskAttemptContext = _
    +  var serializer: OrcSerde = _
    +  var wrappers: Array[Any => Any] = _
    +  var created = false
    +  var path: String = _
    +  var dataSchema: StructType = _
    +  var fieldOIs: Array[ObjectInspector] = _
    +  var standardOI: StructObjectInspector = _
    --- End diff --
    
    `structOI`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message