spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sree Eedupuganti <s...@inndata.in>
Subject How to perform Join operation using JAVARDD
Date Sat, 17 Dec 2016 10:49:58 GMT
I tried like this,

*CrashData_1.csv:*

*CRASH_KEY    CRASH_NUMBER      CRASH_DATE    CRASH_MONTH*
*2016899114     2016899114                  01/02/2016           12:00:00
AM +0000*

*CrashData_2.csv:*

*CITY_NAME    ZIPCODE             CITY                     STATE*
*1945                 704               PARC PARQUE           PR*


Code:

*JavaRDD<String> firstRDD =
sc.textFile("/Users/apple/Desktop/CrashData_1.csv");*

*JavaRDD<String> secondRDD =
sc.textFile("/Users/apple/Desktop/CrashData_2.csv");*

*JavaRDD<String> allRDD = firstRDD.union(secondRDD);*


*Output i am getting:*

*[CRASH_KEY,CRASH_NUMBER,CRASH_DATE,CRASH_MONTH,
2016899114,2016899114,01/02/2016 12:00:00 AM +0000 *

*CITY_NAME,ZIPCODE,CITY,STATE, **1945,704,PARC PARQUE,PR]*




*Any suggesttions please, Thanks in advance....*

Mime
View raw message