public abstract class BaseRelation
extends Object
StructType
. Concrete
implementation should inherit from one of the descendant Scan
classes, which define various
abstract methods for execution.
BaseRelations must also define an 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 and Description |
---|
BaseRelation() |
Modifier and Type | Method and Description |
---|---|
boolean |
needConversion()
Whether does it need to convert the objects in Row to internal representation, for example:
java.lang.String to UTF8String
java.lang.Decimal to Decimal
|
abstract StructType |
schema() |
long |
sizeInBytes()
Returns an estimated size of this relation in bytes.
|
abstract SQLContext |
sqlContext() |
Filter[] |
unhandledFilters(Filter[] filters)
Returns the list of
Filter s that this datasource may not be able to handle. |
public abstract SQLContext sqlContext()
public abstract StructType schema()
public long sizeInBytes()
public boolean needConversion()
If needConversion
is false
, buildScan() should return an RDD
of InternalRow
public Filter[] unhandledFilters(Filter[] filters)
Filter
s that this datasource may not be able to handle.
These returned Filter
s will be evaluated by Spark SQL after data is output by a scan.
By default, this function will return all filters, as it is always safe to
double evaluate a Filter
. However, specific implementations can override this function to
avoid double filtering when they are capable of processing a filter internally.
filters
- (undocumented)