Do we need to download files to desktop for this one ? where is the link to download order_items?


#1

import scala.io.Source

object OrderRevenue {
def main(args: Array[String]) = {
val orderItems = Source.fromFile("/data/retail_db/order_items/part-00000").getLines
val orderRevenue = orderItems.
filter(oi => oi.split(",")(1).toInt == 2).
map(orderItem => oi.split(",")(4).toFloat).
reduce((t, v) => t + v)
print(orderRevenue)
}
}

http://www.itversity.com/topic/cca175-development-life-cycle-sbt-and-scala/


#2

Where are you trying this?

In case if you want to setup data set on your PC, please follow this video


#3

ok thankyou I am using both Itversity lab and installed scala on windows