Github user marmbrus commented on a diff in the pull request: https://github.com/apache/spark/pull/11509#discussion_r55256446 --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/sources/SimpleTextRelation.scala --- @@ -1,265 +0,0 @@ -/* - * 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.sources - -import java.text.NumberFormat - -import com.google.common.base.Objects -import org.apache.hadoop.fs.{FileStatus, Path} -import org.apache.hadoop.io.{NullWritable, Text} -import org.apache.hadoop.mapreduce.{Job, RecordWriter, TaskAttemptContext} -import org.apache.hadoop.mapreduce.lib.output.{FileOutputFormat, TextOutputFormat} - -import org.apache.spark.TaskContext -import org.apache.spark.rdd.RDD -import org.apache.spark.sql.{sources, Row, SQLContext} -import org.apache.spark.sql.catalyst.{expressions, CatalystTypeConverters} -import org.apache.spark.sql.catalyst.expressions._ -import org.apache.spark.sql.types.{DataType, StructType} - -/** - * A simple example [[HadoopFsRelationProvider]]. - */ -class SimpleTextSource extends HadoopFsRelationProvider { --- End diff -- This test implementation should be recreated using the `FileFormat` API and that is tracked by [SPARK-13681](https://issues.apache.org/jira/browse/SPARK-13681) and [SPARK-13729](https://issues.apache.org/jira/browse/SPARK-13729). I think that we could accomplish what we want with a much simpler implementation. All of the code here that is doing actual parsing isn't really testing anything other than itself. I'd prefer to see the new version look more like the tests we have for [DataFrameWriter](https://github.com/apache/spark/blob/master/sql/core/src/test/scala/org/apache/spark/sql/streaming/DataFrameReaderWriterSuite.scala). All you care about is that when users call the public API the correct information makes it down to the interfaces. If the goal is to make sure that users can write a real data source using this API then we should just port spark-avro before 2.0. Even with this test implementation we missed a whole bunch of performance problems (file handling requires massive unions because SqlNewHadoopRdd2 isn't public). These were quickly found in that implementation because people were really using it.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org