1) Dockerをインストール
2) Dockerを起動
3) Beeline のコンテナー起動
docker run -it bde2020/hive /bin/bash
4) CDWのJDBC URIを取得
Data Warehouseに入る。
【Virtual Warehouses】ー>接続したいCDWのVirtual Warehouse選ぶ。
右側の三点のメニューをクリックし、「Copy JDBC URL」をクリック。
私の場合は下記URL:
jdbc:hive2://hs2-zzeng-iceberg-hive-vw.dw-******.******.cloudera.site/default;transportMode=http;httpPath=cliservice;socketTimeout=60;ssl=true;auth=browser;
これに基づいて、
Beeline コマンドを作る:
# beeline -n <csso_username> -p <password> -u "jdbc:hive2://hs2-zzeng-iceberg-hive-vw.dw-******.******.cloudera.site/default;transportMode=http;httpPath=cliservice;socketTimeout=60;ssl=true;auth=browser;"
5) 動作確認
[zzeng@zeng-mbp ~]$ docker run -it bde2020/hive /bin/bash
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Configuring core
- Setting fs.defaultFS=hdfs://f79932f343d9:8020
Configuring hdfs
Configuring yarn
Configuring httpfs
Configuring kms
Configuring mapred
Configuring hive
Configuring for multihomed network
root@f79932f343d9:/opt#
root@f79932f343d9:/opt# beeline -n zzeng -p ******** -u "jdbc:hive2://hs2-zzeng-iceberg-hive-vw.dw-******.******.cloudera.site/default;transportMode=http;httpPath=cliservice;socketTimeout=60;ssl=true;auth=browser;"
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hive/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-2.7.4/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://hs2-zzeng-iceberg-hive-vw.dw-se-sandboxx-aws.a465-9q4k.cloudera.site/default;transportMode=http;httpPath=cliservice;socketTimeout=60;ssl=true;auth=browser;
Connected to: Apache Hive (version 3.1.3000.2024.0.17.0-73)
Driver: Hive JDBC (version 2.3.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 2.3.2 by Apache Hive
0: jdbc:hive2://hs2-zzeng-iceberg-hive-vw.dw->
0: jdbc:hive2://hs2-zzeng-iceberg-hive-vw.dw-> show databases;
INFO : Compiling command(queryId=hive_20240314095722_23905dc8-7ab9-4420-8a21-70d81a905995): show databases
INFO : Semantic Analysis Completed (retrial = false)
INFO : Created Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=hive_20240314095722_23905dc8-7ab9-4420-8a21-70d81a905995); Time taken: 0.012 seconds
INFO : Executing command(queryId=hive_20240314095722_23905dc8-7ab9-4420-8a21-70d81a905995): show databases
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=hive_20240314095722_23905dc8-7ab9-4420-8a21-70d81a905995); Time taken: 0.009 seconds
INFO : OK
+----------------------------+
| database_name |
+----------------------------+
| airlinedata |
...
| zzeng_airlines_csv |
| zzeng_airlines_ice |
+----------------------------+
18 rows selected (1.67 seconds)
0: jdbc:hive2://hs2-zzeng-iceberg-hive-vw.dw->