Advertisement
Guest User

Untitled

a guest
Dec 27th, 2016
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. 0: jdbc:hive2://localhost:10000> CREATE TABLE IF NOT EXISTS employee ( eid int, name String,salary String, destination String) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' STORED AS TEXTFILE;
  2. No rows affected (0.125 seconds)
  3. 0: jdbc:hive2://localhost:10000> LOAD DATA LOCAL INPATH '/opt/docker/sample.txt' INTO TABLE employee;
  4. No rows affected (0.205 seconds)
  5. 0: jdbc:hive2://localhost:10000> SELECT * FROM employee;
  6. +---------------+----------------+------------------+-----------------------+--+
  7. | employee.eid | employee.name | employee.salary | employee.destination |
  8. +---------------+----------------+------------------+-----------------------+--+
  9. | 1201 | Gopal | 45000 | Technical manager |
  10. | 1202 | Manisha | 45000 | Proof reader |
  11. | 1203 | Masthanvali | 40000 | Technical writer |
  12. | 1204 | Kiran | 40000 | Hr Admin |
  13. | 1205 | Kranthi | 30000 | Op Admin |
  14. +---------------+----------------+------------------+-----------------------+--+
  15. 5 rows selected (0.143 seconds)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement