Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.apache.spark.sql.SparkSession
- val spark = SparkSession
- .builder()
- .appName("Spark SQL basic example")
- .config("spark.some.config.option", "some-value")
- .getOrCreate()
- val df = spark.read.json("/home/vagrant/people.json")
- // Displays the content of the DataFrame to stdout
- df.show()
- // +----+-------+
- // | age| name|
- // +----+-------+
- // |null|Michael|
- // | 30| Andy|
- // | 19| Justin|
- // +----+-------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement