Class CassandraDataSink

  • All Implemented Interfaces:
    org.apache.spark.sql.sources.CreatableRelationProvider, org.apache.spark.sql.sources.DataSourceRegister

    public class CassandraDataSink
    extends java.lang.Object
    implements org.apache.spark.sql.sources.DataSourceRegister, org.apache.spark.sql.sources.CreatableRelationProvider
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.spark.sql.sources.BaseRelation createRelation​(org.apache.spark.sql.SQLContext sqlContext, org.apache.spark.sql.SaveMode saveMode, scala.collection.immutable.Map<java.lang.String,​java.lang.String> parameters, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> data)  
      protected BulkWriterContextFactory factory()  
      java.lang.String shortName()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CassandraDataSink

        public CassandraDataSink()
    • Method Detail

      • shortName

        @NotNull
        public java.lang.String shortName()
        Specified by:
        shortName in interface org.apache.spark.sql.sources.DataSourceRegister
      • createRelation

        @NotNull
        public org.apache.spark.sql.sources.BaseRelation createRelation​(@NotNull
                                                                        org.apache.spark.sql.SQLContext sqlContext,
                                                                        @NotNull
                                                                        org.apache.spark.sql.SaveMode saveMode,
                                                                        @NotNull
                                                                        scala.collection.immutable.Map<java.lang.String,​java.lang.String> parameters,
                                                                        @NotNull
                                                                        org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> data)
        Specified by:
        createRelation in interface org.apache.spark.sql.sources.CreatableRelationProvider
        Parameters:
        sqlContext - the SQLContext instance
        saveMode - must be SaveMode.Append
        parameters - the writer options
        data - the data to persist into the Cassandra table
        Throws:
        org.apache.cassandra.spark.exception.UnsupportedAnalyticsOperationException - if the saveMode is not supported. Only SaveMode.Append is supported