Class CassandraBulkSourceRelation
- java.lang.Object
-
- org.apache.spark.sql.sources.BaseRelation
-
- org.apache.cassandra.spark.bulkwriter.CassandraBulkSourceRelation
-
- All Implemented Interfaces:
org.apache.spark.sql.sources.InsertableRelation
public class CassandraBulkSourceRelation extends org.apache.spark.sql.sources.BaseRelation implements org.apache.spark.sql.sources.InsertableRelation
-
-
Constructor Summary
Constructors Constructor Description CassandraBulkSourceRelation(BulkWriterContext writerContext, org.apache.spark.sql.SQLContext sqlContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelJob(CancelJobEvent cancelJobEvent)voidinsert(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> data, boolean overwrite)org.apache.spark.sql.types.StructTypeschema()longsizeInBytes()org.apache.spark.sql.SQLContextsqlContext()protected voidunpersist()Deletes cached copies of the broadcast on the executors
-
-
-
Constructor Detail
-
CassandraBulkSourceRelation
public CassandraBulkSourceRelation(BulkWriterContext writerContext, org.apache.spark.sql.SQLContext sqlContext)
-
-
Method Detail
-
sqlContext
@NotNull public org.apache.spark.sql.SQLContext sqlContext()
- Specified by:
sqlContextin classorg.apache.spark.sql.sources.BaseRelation
-
schema
@NotNull public org.apache.spark.sql.types.StructType schema()
- Specified by:
schemain classorg.apache.spark.sql.sources.BaseRelation- Returns:
- An empty
StructType, as this is a writer only, so schema is not applicable
-
sizeInBytes
public long sizeInBytes()
- Overrides:
sizeInBytesin classorg.apache.spark.sql.sources.BaseRelation- Returns:
0size as not applicable use by the planner in the writer-only use case
-
insert
public void insert(@NotNull org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> data, boolean overwrite)- Specified by:
insertin interfaceorg.apache.spark.sql.sources.InsertableRelation
-
cancelJob
public void cancelJob(@NotNull CancelJobEvent cancelJobEvent)
-
unpersist
protected void unpersist()
Deletes cached copies of the broadcast on the executors
-
-