Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hiveconnection <- dbConnect(drv,
- "jdbc:hive2://xxxxx:10001/default",
- "xxxxx",
- "xxxxx",
- ssl="true",
- sslTrustStore="mytruststore.jks",
- trustStorePassword="xxxxx",
- hive.server2.transport.mode="http",
- hive.server2.thrift.http.path="gateway/default/hive
- )
- library(rJava)
- library(RJDBC)
- hive.class.path = list.files(path=c('/path/to/build/hivedrivers/'), pattern="jar", full.names=T);
- .jinit(classpath=hive.class.path,parameters="")
- drv <- JDBC("org.apache.hive.jdbc.HiveDriver","hive-jdbc-2.0.0.jar",identifier.quote="`")
- conn <- dbConnect(drv,
- 'jdbc:hive2://myhost:10000/default;ssl=true;sslTrustStore=/path/to/truststore.jks;trustStorePassword=mypassword;',
- username,
- password
- )
- show_databases <- dbGetQuery(conn, "show databases")
- print(show_databases)
- repositories {
- mavenCentral()
- }
- configurations {
- drivers
- }
- dependencies {
- drivers "org.apache.hive:hive-jdbc:2.0.0"
- }
- task CopyDrivers(type: Copy) {
- from configurations.drivers
- into "$buildDir/hivedrivers"
- }
- $ gradle CopyDrivers
- $ BI_HOST=bi4c-xxxxx-master-3.bi.services.bluemix.net
- $ openssl s_client -showcerts -connect $BI_HOST:9443 < /dev/null | openssl x509 -outform PEM > certificate
- $ rm -f truststore.jks
- $ keytool -import -trustcacerts -alias biginsights -file certificate -keystore truststore.jks -storepass mypassword -noprompt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement