Sign inSign up

laithleo/hive

By laithleo

Updated almost 5 years ago

Apache Hive 2.3.9 on top of Apache Hadoop 3.3.1 and running YARN is the job executer

Image
Data science
Databases & storage
3

10K+

laithleo/hive repository overview

Apache Hive 2.3.9 on top of Apache Hadoop 3.3.1 and running YARN is the job executer

  • Running on top of Ubuntu 20.04
  • OSS Apache Hive 2.3.9, located locally on /opt/hive-2.3.9
  • Ready to be used with beeline.
  • All hive commands are included in PATH, no need to use the absolute path.
  • HDFS commands are included in PATH as well.
  • HDFS and YARN ready to test your Apache Hadoop work!

Build the image

docker build -t laithleo/hive:2.3.9 .

Pull the image:

docker pull laithleo/hive:2.3.9

Start a container

docker run -p 8088:8088 -p 10000:10000 -it laithleo/hive:2.3.9 /tmp/bootstrap.sh -bash

For testing

beeline> !connect jdbc:hive2://localhost:10000/;
Connecting to jdbc:hive2://localhost:10000/;
Enter username for jdbc:hive2://localhost:10000/: user
Enter password for jdbc:hive2://localhost:10000/: ****
Connected to: Apache Hive (version 2.3.9)
Driver: Hive JDBC (version 2.3.9)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://localhost:10000/> show databases;
OK
+----------------+
| database_name  |
+----------------+
| default        |
+----------------+
1 row selected (1.813 seconds)
0: jdbc:hive2://localhost:10000/>

You can use one of the provided examples:

0: jdbc:hive2://localhost:10000/> CREATE TABLE invites (foo INT, bar STRING) PARTITIONED BY (ds STRING);
OK
No rows affected (0.822 seconds)
0: jdbc:hive2://localhost:10000/> LOAD DATA LOCAL INPATH '/opt/hive-2.3.9/examples/files/kv2.txt' OVERWRITE INTO TABLE invites PARTITION (ds='2008-08-15');
Loading data to table default.invites partition (ds=2008-08-15)
OK
No rows affected (1.448 seconds)
0: jdbc:hive2://localhost:10000/>```

To see some output of your data with select, do:

```0: jdbc:hive2://localhost:10000/> select * from invites LIMIT 10;
OK
+--------------+--------------+-------------+
| invites.foo  | invites.bar  | invites.ds  |
+--------------+--------------+-------------+
| 474          | val_475      | 2008-08-15  |
| 281          | val_282      | 2008-08-15  |
| 179          | val_180      | 2008-08-15  |
| 291          | val_292      | 2008-08-15  |
| 62           | val_63       | 2008-08-15  |
| 271          | val_272      | 2008-08-15  |
| 217          | val_218      | 2008-08-15  |
| 135          | val_136      | 2008-08-15  |
| 167          | val_168      | 2008-08-15  |
| 468          | val_469      | 2008-08-15  |
+--------------+--------------+-------------+
10 rows selected (0.257 seconds)
0: jdbc:hive2://localhost:10000/>

Tag summary

Content type

Image

Digest

Size

1.6 GB

Last updated

almost 5 years ago

docker pull laithleo/hive