Skip to content

Commit

Permalink
Added baseRelationToSchemaRDD back.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxin committed Jan 15, 2015
1 parent 4a38c9b commit ecd6685
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import org.apache.spark.sql.catalyst.rules.RuleExecutor
import org.apache.spark.sql.execution._
import org.apache.spark.sql.json._
import org.apache.spark.sql.parquet.ParquetRelation
import org.apache.spark.sql.sources.{DDLParser, DataSourceStrategy}
import org.apache.spark.sql.sources.{LogicalRelation, BaseRelation, DDLParser, DataSourceStrategy}
import org.apache.spark.sql.types._

/**
Expand Down Expand Up @@ -130,6 +130,13 @@ class SQLContext(@transient val sparkContext: SparkContext)
new SchemaRDD(this, LogicalRDD(attributeSeq, rowRDD)(self))
}

/**
* Convert a [[BaseRelation]] created for external data sources into a [[SchemaRDD]].
*/
def baseRelationToSchemaRDD(baseRelation: BaseRelation): SchemaRDD = {
new SchemaRDD(this, LogicalRelation(baseRelation))
}

/**
* :: DeveloperApi ::
* Creates a [[SchemaRDD]] from an [[RDD]] containing [[Row]]s by applying a schema to this RDD.
Expand Down

0 comments on commit ecd6685

Please sign in to comment.