Created
August 16, 2016 17:46
-
-
Save JRuumis/b398aea0309be82828dd215f5ac039f3 to your computer and use it in GitHub Desktop.
This file contains 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
import org.apache.spark.sql.SparkSession | |
/** | |
* Created by Janis Rumnieks on 16/08/2016. | |
*/ | |
object SqlTest { | |
def main(args: Array[String]): Unit = { | |
val sparkSession = SparkSession | |
.builder() | |
.appName("Sql Test") | |
.master("local[*]") | |
.config("sparkSession.sql.warehouse.dir", ".") | |
.getOrCreate() | |
//val peopleSourceFilePath = """C:\Developer\Spark\Spark_2.0.0\spark-2.0.0-bin-hadoop2.7\examples\src\main\resources\people.json""" | |
val peopleSourceFilePath = "people.json" | |
val peopleDataFrame = sparkSession.read.json(peopleSourceFilePath) | |
peopleDataFrame.show() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment