Move Spark data into a new Julia DataFrame.
ds:Dataset
: the Apache Spark Dataset to import into Julia as a DataFrame.The function supports the following data types when creating Julia DataFrames from Spark data:
String
Date
Timestamp
integer
long
double
float
decimal
boolean
You must include the DataFrames package in your Julia program.
Using DataFrames
Include the “Dates” and “Decimals” packages if your Spark data contains dates or decimal numbers.
Using Dates, Decimals
stmt = sql(session, "SELECT _c0 AS columnName1, _c1 AS columnName2 FROM CSV.`/pathToFile/fileName.csv`")
createOrReplaceTempView(stmt, "TempViewName")
sqlQuery = sql(session, "SELECT columnName1, columnName2 FROM TempViewName;")
juliaDataFrame = toJuliaDF(sqlQuery)