Last active
September 4, 2019 09:22
-
-
Save dgadiraju/fc932f6eb581d94a5a357f7d268e9a7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val orders = sc.textFile("/public/retail_db/orders") | |
orders. | |
map(o => o.split(",")(1)). | |
take(10). | |
foreach(println) | |
orders. | |
map(o => o.split(",")(1)). | |
distinct. | |
collect. | |
foreach(println) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orders. | |
map(o => o.split(",")(3)). | |
take(10). | |
foreach(println) | |
orders. | |
map(o => o.split(",")(3)). | |
distinct. | |
collect. | |
foreach(println) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orders. | |
map(o => (o.split(",")(0).toInt, o.split(",")(1))). | |
take(10). | |
foreach(println) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orders. | |
map(o => (o.split(",")(0).toInt, o.split(",")(1).substring(0, 7).replace("-", "").toInt)). | |
take(10). | |
foreach(println) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment