In this example: saveToCassandra place can have the update method?
Lines. The map (x=& gt; (x) _1, x. _7), (x) _5, x. _6)))
ReduceByKey ((x, y)=& gt; (x) _1 + y) _1, x. _2 + y. _2))
The map (x=& gt; (x) _1) _1, x. _1, _2, x. _2. _1, x. _2) _2))
Logt_stats casdemo saveToCassandra (" ", "", SomeColumns (" accesstime", "name", "count", "bytes"))
CodePudding user response:
foreachPartitionCodePudding user response:
I do not know the building Lord specific application scenario,Direct saveToCassandra, consistent data contains the original table's primary key insert is updated,
If the original table as
Id, name, age
Li 18 1
2 Wang 20
PrimaryKey (id)
1 Zhang, 22
Direct insertion somecolumn (id, name, age)
Is updated to:
Id, name, age
1 Zhang, 22
2 Wang 20
PrimaryKey (id)