Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. from __future__ import division
  2.  
  3. from pyspark.shell import sc
  4.  
  5.  
  6. def main():
  7. from pyspark.sql import SQLContext
  8. sql_context = SQLContext(sc)
  9.  
  10. df = sql_context.read.format('com.databricks.spark.csv').options(header='true', inferschema='true') \
  11. .load('/home/jkovacevic/PycharmProjects/spark_demo/transaction_demo.csv')
  12. df.show(5)
  13. df.printSchema();
  14.  
  15. if __name__ == "__main__":
  16. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement