Guest User

Untitled

a guest
Mar 18th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. from pyspark.sql import SparkSession
  2. from pyspark.sql import Row
  3. warehouse_location = 'hdfs://quickstart.cloudera:8020/user/hive/warehouse'
  4.  
  5. spark = SparkSession
  6. .builder
  7. .appName("Python Spark SQL Hive integration example")
  8. .config("spark.sql.warehouse.dir", warehouse_location)
  9. .enableHiveSupport()
  10. .getOrCreate()
  11.  
  12. spark.sql("use qadb")
  13.  
  14. <property>
  15. <name>javax.jdo.option.ConnectionURL</name>
  16. <value>jdbc:mysql://quickstart.cloudera:8020/metastore?createDatabaseIfNotExist=true</value>
  17. <description>JDBC connect string for a JDBC metastore</description>
  18. </property>
  19.  
  20. <property>
  21. <name>javax.jdo.option.ConnectionDriverName</name>
  22. <value>com.mysql.jdbc.Driver</value>
  23. <description>Driver class name for a JDBC metastore</description>
  24. </property>
  25.  
  26. <property>
  27. <name>javax.jdo.option.ConnectionUserName</name>
  28. <value>hive</value>
  29. </property>
  30.  
  31. <property>
  32. <name>javax.jdo.option.ConnectionPassword</name>
  33. <value>cloudera</value>
  34. </property>
  35.  
  36. <property>
  37. <name>hive.hwi.war.file</name>
  38. <value>/usr/lib/hive/lib/hive-hwi-0.8.1-cdh4.0.0.jar</value>
  39. <description>This is the WAR file with the jsp content for Hive Web Interface</description>
  40. </property>
  41.  
  42. <property>
  43. <name>datanucleus.fixedDatastore</name>
  44. <value>true</value>
  45. </property>
  46.  
  47. <property>
  48. <name>datanucleus.autoCreateSchema</name>
  49. <value>false</value>
  50. </property>
  51.  
  52. <property>
  53. <name>hive.metastore.uris</name>
  54. <value>thrift://quickstart.cloudera:8020</value>
  55. <description>IP address (or fully-qualified domain name) and port of the metastore host</description>
  56. </property>
Add Comment
Please, Sign In to add comment