Skip to content

Instantly share code, notes, and snippets.

@akhilanandbv003
Last active February 25, 2019 04:51
Show Gist options
  • Save akhilanandbv003/6dafb46de75f4e05d7ba5206e3ec6b94 to your computer and use it in GitHub Desktop.
Save akhilanandbv003/6dafb46de75f4e05d7ba5206e3ec6b94 to your computer and use it in GitHub Desktop.
payment Dataframe
scala> val payment = sc.parallelize(Seq(
| (1, 101,2500), (2,102,1110), (3,103,500), (4 ,104,400), (5 ,105, 150), (6 ,106, 450)
| )).toDF("paymentId", "customerId","amount")
payment: org.apache.spark.sql.DataFrame = [paymentId: int, customerId: int ... 1 more field]
scala> payment.show
+---------+----------+------+
|paymentId|customerId|amount|
+---------+----------+------+
| 1| 101| 2500|
| 2| 102| 1110|
| 3| 103| 500|
| 4| 104| 400|
| 5| 105| 150|
| 6| 106| 450|
+---------+----------+------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment