3582518438

3582518438




-> O A github.com/bhargavi1411/BigDataProgramming/wiki/LAB-ASSIGNMENT-2 Apps

//a. Inport the dataset and create df and prlnt Scheoa

val dfl = spark.read .fornat( saxcc- "csv")

.optionCheader", truć") //rcading the headcrs . opt lon( "itode", ••PftOPWLFOftHED")

•load( path . 7Users/bharoavichcnnupatl/Pownloads/LAB/WorldCups.csv")

val df2 = spark.read .tomat< scu-ce- "csv")

.optionCheader", truć") //rcading thc headcrs .optionCnode", "OftOPHALFORMED")

.load( patb- ,7Users/bharqavlchennupati/Pc»»nloads/LAB/NorldCupPlayers.csv“)

val df3 = spark.read .fonrat( sarcc- “csv")

.optionCheader”, “true") //reading the headers . opt ion ("irode". "OflOPMAi.FOWMEp")

.load( path ■ “/Uscrs/bhdroayictłcnnupati/Dwnioads/LAB/WorldCupHatchcs.csy")

// Printing the Schena dfl.printSchenaO df2.printSchena() df3.printSche*aO

//b.Perfom 10 intuitlve questlons In Dataset //For thls prób len we have used thel&iark Sql on DataFranes

//First of all create three Teirp View dfl.createOrfieplaccTenpView( vic»Namc. "WC") df2.crcatcOrRcplaccTcnpVicw( viewNacr>e - "Playcrs") df3.crcatc0rftcplaccTcnpVicw( yicwNan-.i-a "Natchcs") // Find the winner by years uslng WorldCup view

val O = sparfc.sql< iqlText - "select Winner, Country, Year fro* WC Order By Country ")

0. słtowO

//Find the goals by years using WorldCup view

val 01 » spark.sql( sqlT*«t - “select Oualif ledTeans, MatchesPlayed, Year fron WC WWERE Country ‘Brazll* Order By Year")

01. showO

//Cities that hostcd highcst world cup natchcs on vicw wcttatchcs

vat 02 = spark.sql( sqlTw< - "sclcct Count(City),City fron Hatchcs Group By City")

Q2.show() //Find the goals by years using WorldCup view

val Q1 = spark.sql( sqiT«xt - “select Oualif:edTeans, MatchesPlayed, Year fron we WHERE Country = ‘Brazll* Order By Year") Ol.showO

//Cities that hosted highest world cup natches on view wcMatches

val 02 ■ spark.sql( o ir*t- "select Count(City),City fron Matchcs Group By City )

O2.show()


Wyszukiwarka

Podobne podstrony:
Lab 7 Assignment 3: presentation and assessment of results 2 Lab 8 Assignment 4: identification of
00108 ?f6a04c8cedb37f31d46a92d3aa878d 108 McWilliams that found using the morę complex multiple ass
TP Al terima it rngr-S iidies Com Ib ibnigp iredhnni iicjpute Steps 1.2 and 3 are the same as the O
gfigs03 New Project Information 3 ATL COM AppWizard will create a new skelelon project wilh the foll
gfigs03 New Project Information 3 ATL COM AppWizard will create a new skelelon project wilh the foll
ATH Micro-Technologies AssignmentPart A Q1 Does the eam-out structure focus on the right performance
099 (6) 11 boi andsheepgo logether; jo //ow com/</ o# not hąve a sheep in /his book? Although the
Student #:_ Lab Section:. Lab #11 Ouiz Ouestion 1. The demand curve for karate training in a communi
dfig03 3 New Project Information ATL COM AppWizard will create a new skeleton project with the follo
Materiał Testirig Lab Materiał Testing Lab is one of the most important labs in the field of civil e
Overview of Dynamie Address Assignment Dynamieaddressing is the default addressing raethod in Window
CeII Transport Lab Series GLUE IN THE FOLLOWING PROCEDURES AND CREATE DATA TABLES IN YOUR LAB MANUAŁ
jfig03 New Project Information H ATL COM AppWizard will create a new skeleton project with the follo
PRECEDENT AMY SMITH D-LAB This iteration reduced the amount of materiał necessary, was easier to con
34 3 http ://groups. msn. com, linę (#2 scriptDragonfly Touch, lift, touch, lift all the way to tip

więcej podobnych podstron