Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scala> val hc = new org.apache.spark.sql.hive.HiveContext(sc)
- warning: there was one deprecation warning; re-run with -deprecation for details
- hc: org.apache.spark.sql.hive.HiveContext = org.apache.spark.sql.hive.HiveContext@6dde913e
- scala> hc.setConf("hive.metastore.uris","thrift://127.0.0.1:9083")
- scala> val df = hc.sql("show databases")
- df: org.apache.spark.sql.DataFrame = [databaseName: string]
- scala> df.show
- +------------+
- |databaseName|
- +------------+
- | default|
- +------------+
- scala> val dfTables = hc.sql("show tables");
- dfTables: org.apache.spark.sql.DataFrame = [database: string, tableName: string ... 1 more field]
- scala> dfTables.show
- +--------+---------+-----------+
- |database|tableName|isTemporary|
- +--------+---------+-----------+
- +--------+---------+-----------+
- hive> show databases;
- OK
- default
- mydbbackup
- Time taken: 7.593 seconds, Fetched: 2 row(s)
- hive> use mydbbackup;
- OK
- Time taken: 0.021 seconds
- hive> show tables;
- OK
- customers
- customerspart
- customerspart1
- Time taken: 0.194 seconds, Fetched: 3 row(s)
- hive>
- <configuration>
- <property>
- <name>javax.jdo.option.ConnectionURL</name>
- <value>jdbc:derby:;databaseName=/home/hduser/apache-hive-2.3.0-bin/metastore_db;create=true</value>
- <description>
- JDBC connect string for a JDBC metastore.
- To use SSL to encrypt/authenticate the connection, provide database-specific SSL flag in the connection URL.
- For example, jdbc:postgresql://myhost/db?ssl=true for postgres database.
- </description>
- </property>
- <property>
- <name>hive.metastore.warehouse.dir</name>
- <value>/user/hive/warehouse</value>
- <description>location of default database for the warehouse</description>
- </property>
- <property>
- <name>hive.metastore.uris</name>
- <value/>
- <description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
- </property>
- <property>
- <name>javax.jdo.option.ConnectionDriverName</name>
- <value>org.apache.derby.jdbc.EmbeddedDriver</value>
- <description>Driver class name for a JDBC metastore</description>
- </property>
- <property>
- <name>javax.jdo.PersistenceManagerFactoryClass</name>
- <value>org.datanucleus.api.jdo.JDOPersistenceManagerFactory</value>
- <description>class implementing the jdo persistence</description>
- </property>
- </configuration>
- total 40
- drwxr-xr-x 2 root root 4096 Nov 12 20:22 ./
- drwxr-xr-x 12 root root 4096 Nov 9 22:57 ../
- -rw-r--r-- 1 root root 996 Nov 9 22:57 docker.properties.template
- -rw-r--r-- 1 root root 1105 Nov 9 22:57 fairscheduler.xml.template
- -rw-r--r-- 1 root root 2025 Nov 9 22:57 log4j.properties.template
- -rw-r--r-- 1 root root 7313 Nov 9 22:57 metrics.properties.template
- -rw-r--r-- 1 root root 865 Nov 9 22:57 slaves.template
- -rw-r--r-- 1 root root 1292 Nov 9 22:57 spark-defaults.conf.template
- -rwxr-xr-x 1 root root 3699 Nov 9 22:57 spark-env.sh.template*
Add Comment
Please, Sign In to add comment