Skip to content

Instantly share code, notes, and snippets.

@cinek810
Created December 8, 2020 15:21
Show Gist options
  • Save cinek810/764fd40c30dce0b28ef0f6f1b67b1796 to your computer and use it in GitHub Desktop.
Save cinek810/764fd40c30dce0b28ef0f6f1b67b1796 to your computer and use it in GitHub Desktop.
# cat /home/vagrant/external_path/*
1,jane,doe,senior,mathematics
2,john,smith,junior,engineering
# hive
which: no hbase in (/home/vagrant/hadoop/hadoop-3.3.0/bin/:/home/vagrant/hadoop/apache-hive-2.3.7-bin/bin:/home/vagrant/hadoop/jre1.8.0_271/bin:/home/vagrant/hadoop/hadoop-3.3.0/bin/:/home/vagrant/hadoop/apache-hive-2.3.7-bin/bin:/home/vagrant/hadoop/jre1.8.0_271/bin:/mnt/slurm/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/vagrant/hadoop/hadoop-2.10.1//sbin:/home/vagrant/hadoop/hadoop-2.10.1//bin:/home/vagrant/hadoop/hadoop-2.10.1//sbin:/home/vagrant/hadoop/hadoop-2.10.1//bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/vagrant/hadoop/apache-hive-2.3.7-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/vagrant/hadoop/hadoop-2.10.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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]
2020-12-08 14:38:58,021 main ERROR Unable to locate appender "DEBUG" for logger config "root"
Logging initialized using configuration in jar:file:/home/vagrant/hadoop/apache-hive-2.3.7-bin/lib/hive-common-2.3.7.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
hive> CREATE EXTERNAL TABLE IF NOT EXISTS names_text(
> student_ID INT, FirstName STRING, LastName STRING,
> year STRING, Major STRING)
> COMMENT 'Student Names'
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY ','
> STORED AS TEXTFILE
> LOCATION '/home/vagrant/extarnal_path/';
OK
Time taken: 6.242 seconds
hive> select * from names_text;
OK
1 jane doe senior mathematics
2 john smith junior engineering
Time taken: 0.209 seconds, Fetched: 2 row(s)
hive>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment