|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.apache.spark.sql.sources.BaseRelation
public abstract class BaseRelation
::DeveloperApi::
Represents a collection of tuples with a known schema. Classes that extend BaseRelation must
be able to produce the schema of their data in the form of a StructType
. Concrete
implementation should inherit from one of the descendant Scan
classes, which define various
abstract methods for execution.
BaseRelations must also define a equality function that only returns true when the two instances will return the same data. This equality function is used when determining when it is safe to substitute cached results for a given relation.
Constructor Summary | |
---|---|
BaseRelation()
|
Method Summary | |
---|---|
boolean |
needConversion()
Whether does it need to convert the objects in Row to internal representation, for example: java.lang.String -> UTF8String java.lang.Decimal -> Decimal |
abstract StructType |
schema()
|
long |
sizeInBytes()
Returns an estimated size of this relation in bytes. |
abstract SQLContext |
sqlContext()
|
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseRelation()
Method Detail |
---|
public abstract SQLContext sqlContext()
public abstract StructType schema()
public long sizeInBytes()
Note that it is always better to overestimate size than underestimate, because underestimation could lead to execution plans that are suboptimal (i.e. broadcasting a very large table).
public boolean needConversion()
Note: The internal representation is not stable across releases and thus data sources outside of Spark SQL should leave this as true.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |