Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [vagrant@c6801 ~]$ vim /tmp/mytestvalue.tsv
- [vagrant@c6801 ~]$ sudo -u hdfs hdfs dfs -put -f /tmp/mytestvalue.tsv /tmp && beeline -u 'jdbc:hive2://c6802.ambari.apache.org:2181,c6803.ambari.apache.org:2181,c6801.ambari.apache.org:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2' -n hdfs
- Connecting to jdbc:hive2://c6802.ambari.apache.org:2181,c6803.ambari.apache.org:2181,c6801.ambari.apache.org:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2
- Connected to: Apache Hive (version 1.2.1000.2.5.3.0-37)
- Driver: Hive JDBC (version 1.2.1000.2.5.3.0-37)
- Transaction isolation: TRANSACTION_REPEATABLE_READ
- Beeline version 1.2.1000.2.5.3.0-37 by Apache Hive
- 0: jdbc:hive2://c6802.ambari.apache.org:2181,> create temporary table mytesttemp like mytesttable stored as textfile;
- No rows affected (0.29 seconds)
- 0: jdbc:hive2://c6802.ambari.apache.org:2181,> alter table mytesttemp set serdeproperties ('serialization.format'='\t', 'field.delim'='\t');
- No rows affected (0.036 seconds)
- 0: jdbc:hive2://c6802.ambari.apache.org:2181,> load data inpath '/tmp/mytestvalue.tsv' into table mytesttemp;
- INFO : Loading data to table default.mytesttemp from hdfs://mynameservice/tmp/mytestvalue.tsv
- INFO : Table default.mytesttemp stats: [numFiles=1, totalSize=17]
- No rows affected (0.123 seconds)
- 0: jdbc:hive2://c6802.ambari.apache.org:2181,> select * from mytesttemp;
- +-------------------+-------------------+--+
- | mytesttemp.mystr | mytesttemp.myint |
- +-------------------+-------------------+--+
- | myteststring | 123 |
- +-------------------+-------------------+--+
- 1 row selected (0.196 seconds)
- 0: jdbc:hive2://c6802.ambari.apache.org:2181,>
Add Comment
Please, Sign In to add comment