java.util.NoSuchElementException: Columns not found in table abc.company_vals: companyId, companyName

Have Cassandra table as below

CREATE TABLE abc.company_vals(     companyId int,     companyName text,     year int,     quarter text,     revenue int,     PRIMARY KEY (companyId, year) ) WITH CLUSTERING ORDER BY ( year DESC ); 

Trying to insert data into the above using spark-structured streaming as below

List<Row> data  = Arrays.asList(                     RowFactory.create(10002 , "TCS",2004,"Q4",7800),                     RowFactory.create(10003, "GE",2004,"Q4",7800),                     RowFactory.create(10004, "Oracle",2004,"Q4",7800),                     RowFactory.create(10005, "epam",2004,"Q4",7800),                     RowFactory.create(10006, "Dhfl",2004,"Q4",7800),                     RowFactory.create(10007, "Infosys",2004,"Q4",7800)                )  StructType schema = new StructType()                       .add("companyId", DataTypes.IntegerType)                       .add("companyName", DataTypes.StringType)                       .add("year", DataTypes.IntegerType)                       .add("quarter", DataTypes.StringType)                       .add("revenue", DataTypes.IntegerType);               Dataset<Row> companyDf = sparkSession.createDataFrame(data, schema).toDF();                companyDf              .write()              .format("org.apache.spark.sql.cassandra")                 .option("table","company_vals")                 .option("keyspace",  "abc")                 .mode(SaveMode.Append)                 .save(); 

Spark code to insert data

Getting error :

java.util.NoSuchElementException: Columns not found in table abc.company_vals: companyId, companyName 

What am I doing wrong here ? how to fix this?