Skip to content

Commit c07abc9

Browse files
authored
Update import-sample.scala
Added ttl doc
1 parent 9daf178 commit c07abc9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scala/datastax-v4/aws-glue/import-from-s3/import-sample.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,16 @@ object GlueApp {
101101

102102
val shuffledDF = sparkSession.createDataFrame(shuffledRDD, orderedData.schema)
103103

104-
shuffledDF.write.format("org.apache.spark.sql.cassandra").mode("append").option("keyspace", keyspaceName).option("table", tableName).save()
104+
shuffledDF
105+
.write
106+
.format("org.apache.spark.sql.cassandra")
107+
.mode("append")
108+
.option("keyspace", keyspaceName)
109+
.option("table", tableName)
110+
//.option("ttl", "ttlCol") //Use the values in ttlCol as the TTL for these inserts.
111+
//you can also provide fixed number '100'
112+
//to use this feature you must enable ttl on the keyspaces table.
113+
.save()
105114

106115
Job.commit()
107116
}

0 commit comments

Comments
 (0)