Q:

Whats the scala spark equivalent of subset of R

Assume I have a data frame df in spark, with the structure like so. 
Input:
amount city
10000  la
12145  ng
14000  wy
18000  la

How can subset the data frame for amount > 10000
Expected Output:
amount city
12145  ng
14000  wy
18000  la

In R i can do something like this:
df1 <- df[df$amount > 10000 ,]

I know I can use SQL of spark to do the same, but what is the step which is similar to above

A:

From the docs:
http://spark.apache.org/docs/latest/sql-programming-guide.html#untyped-dataset-operations-aka-dataframe-operations
val df1 = df.filter($"amount" > 10000)

