Skip to content

Commit

Permalink
Fixes compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed May 12, 2015
1 parent 9d17607 commit fb5a607
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ abstract class FSBasedRelation extends BaseRelation {
def dataSchema: StructType

/**
* Builds an `RDD[Row` containing all rows within this relation.
* Builds an `RDD[Row]` containing all rows within this relation.
*
* @param inputPaths Data files to be read. If the underlying relation is partitioned, only data
* files within required partition directories are included.
Expand All @@ -325,7 +325,7 @@ abstract class FSBasedRelation extends BaseRelation {
}

/**
* Builds an `RDD[Row` containing all rows within this relation.
* Builds an `RDD[Row]` containing all rows within this relation.
*
* @param requiredColumns Required columns.
* @param inputPaths Data files to be read. If the underlying relation is partitioned, only data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ case class SimpleFSBasedRelation
(val sqlContext: SQLContext)
extends FSBasedRelation {

class SimpleOutputWriter extends OutputWriter {
override def write(row: Row): Unit = TestResult.writtenRows += row
}

override val path = parameter("path")

override def dataSchema: StructType =
DataType.fromJson(parameter("schema")).asInstanceOf[StructType]

override def newOutputWriter(path: String): OutputWriter = new OutputWriter {
override def write(row: Row): Unit = TestResult.writtenRows += row
}

override def buildScan(
requiredColumns: Array[String],
filters: Array[Filter],
Expand All @@ -67,6 +67,8 @@ case class SimpleFSBasedRelation

Option(TestResult.rowsToRead).getOrElse(sqlContext.emptyResult)
}

override def outputWriterClass: Class[_ <: OutputWriter] = classOf[SimpleOutputWriter]
}

object TestResult {
Expand Down

0 comments on commit fb5a607

Please sign in to comment.