Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import org.apache.spark.sql.SparkSession
  2.  
  3. val spark = SparkSession
  4. .builder()
  5. .appName("Spark SQL basic example")
  6. .config("spark.some.config.option", "some-value")
  7. .getOrCreate()
  8.  
  9. val df = spark.read.json("/home/vagrant/people.json")
  10.  
  11. // Displays the content of the DataFrame to stdout
  12. df.show()
  13. // +----+-------+
  14. // | age| name|
  15. // +----+-------+
  16. // |null|Michael|
  17. // | 30| Andy|
  18. // | 19| Justin|
  19. // +----+-------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement