0

How TODO an incremental sequence with java in Apache-Spark 2.x DataFrame || TempTable .

In other words what is the equivalent for monotonically_increasing_id() function in ApacheSpark->Sql->java || API->Java

Yugerten
  • 878
  • 1
  • 11
  • 30

1 Answers1

0

with Scala:

val dataFrame1 = dataFrame0.withColumn("index",monotonically_increasing_id())

with java

import org.apache.spark.sql.functions;
Daraset<Row> dataFrame1 = dataFrame0.withColumn("index",functions.monotonically_increasing_id());
Yugerten
  • 878
  • 1
  • 11
  • 30