Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. hive> CREATE EXTERNAL TABLE IF NOT EXISTS result_sf(
  2. > month INT,
  3. > zoneID INT,
  4. > liczba BIGINT)
  5. > COMMENT 'passengers details'
  6. > ROW FORMAT DELIMITED
  7. > FIELDS TERMINATED BY ','
  8. > LINES TERMINATED BY '\n'
  9. > STORED AS TEXTFILE;
  10. OK
  11. Time taken: 0.135 seconds
  12. hive> select * from result_sf;
  13. OK
  14. Time taken: 0.223 seconds
  15. hive> load data local inpath 'result.csv' into table result_sf;
  16. Loading data to table taxizone.result_sf
  17. OK
  18. Time taken: 0.54 seconds
  19. hive> select * from result_sf;
  20. OK
  21. 11 6 NULL
  22. 11 1 NULL
  23. 2 1 NULL
  24. 10 2 NULL
  25. 12 5 NULL
  26. 11 99 NULL
  27. 12 1 NULL
  28. 12 6 NULL
  29. 11 2 NULL
  30. 3 1 NULL
  31. 12 99 NULL
  32. 11 3 NULL
  33. 12 2 NULL
  34. 1 5 NULL
  35. 11 4 NULL
  36. 12 3 NULL
  37. 11 5 NULL
  38. 6 1 NULL
  39. 1 1 NULL
  40. 10 1 NULL
  41. 12 4 NULL
  42. Time taken: 0.193 seconds, Fetched: 21 row(s)
  43. hive> szymonkukla1@klaster-m:~$ cat result.csv
  44. 11,6,30
  45. 11,1,3725072
  46. 02,1,6
  47. 10,2,8
  48. 12,5,7556
  49. 11,99,209
  50. 12,1,4035363
  51. 12,6,30
  52. 11,2,87045
  53. 03,1,5
  54. 12,99,199
  55. 11,3,6615
  56. 12,2,92619
  57. 01,5,2
  58. 11,4,2752
  59. 12,3,7442
  60. 11,5,6522
  61. 06,1,10
  62. 01,1,105
  63. 10,1,158
  64. 12,4,2565
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement