Guest User

Untitled

a guest
Dec 11th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.76 KB | None | 0 0
  1. mysql> select * from customer2;
  2. +-------------+----------------+----------------+----------------+--------- ----------+-----------------+---------------+----------------+------------------+
  3. | customer_id | customer_fname | customer_lname | customer_email | customer_password | customer_street | customer_city | customer_state | customer_zipcode |
  4. +-------------+----------------+----------------+----------------+-------------------+-----------------+---------------+----------------+------------------+
  5. | 100008 | Christine | K | NULL | NULL | HK | HK | HK | 19293 |
  6. | 100009 | Chris | Taylor | NULL | NULL | HK | HK | HK | 1925 |
  7. | 100010 | Mark | Jamiel | NULL | NULL | HK | HK | HK | 19294 |
  8. | 100011 | Tom | Pride | NULL | NULL | HK | HK | HK | 19295 |
  9. | 100012 | Tom | Heather | NULL | NULL | CA | CA | CA | 19295 |
  10. | 100013 | Maxim | Calay | NULL | NULL | CA | CA | CA | 19295 |
  11. +-------------+----------------+----------------+----------------+-------------------+-----------------+---------------+----------------+------------------+
  12.  
  13. hive (sumitpawar)> describe customer2;
  14. OK
  15. col_name data_type comment
  16. customer_id int
  17. customer_fname string
  18. customer_lname string
  19. customer_email string
  20. customer_password string
  21. customer_zipcode string
  22. customer_city string
  23.  
  24. Partition Information
  25. col_name data_type comment
  26.  
  27. customer_city string
  28. Time taken: 0.098 seconds, Fetched: 12 row(s)
  29. hive (sumitpawar)>
  30.  
  31. sqoop import --options-file ./options_file.txt --table customer2 --columns 'customer_id,customer_fname,customer_lname,customer_email,customer_password,customer_zipcode' --hive-database sumitpawar --hive-import --null-string 'Empty' --null-non-string 0 -m 2 --mapreduce-job-name "JOB :import to hive from mysql" --warehouse-dir "/PRACTICALS/SQOP/retail_db/increment_hive_mysql4" --hive-partition-key customer_city --hive-partition-value 'CA'
  32.  
  33. [cloudera@quickstart SQOOP]$ cat options_file.txt
  34. #############################################
  35. --connect
  36. jdbc:mysql://localhost:3306/retail_db
  37.  
  38. --username
  39. root
  40.  
  41. --password-file
  42. /PRACTICALS/SQOOP/password
  43. ############################################
  44.  
  45.  
  46.  
  47. Execution log of SQOOP command
  48.  
  49. 18/12/09 06:59:38 INFO mapreduce.Job: Running job: job_1542647782962_0231
  50. 18/12/09 06:59:49 INFO mapreduce.Job: Job job_1542647782962_0231 running in uber mode : false
  51. 18/12/09 06:59:49 INFO mapreduce.Job: map 0% reduce 0%
  52. 18/12/09 07:00:06 INFO mapreduce.Job: map 50% reduce 0%
  53. 18/12/09 07:00:07 INFO mapreduce.Job: map 100% reduce 0%
  54. 18/12/09 07:00:07 INFO mapreduce.Job: Job job_1542647782962_0231 completed successfully
  55. 18/12/09 07:00:07 INFO mapreduce.Job: Counters: 30
  56. File System Counters
  57. FILE: Number of bytes read=0
  58. FILE: Number of bytes written=311480
  59. FILE: Number of read operations=0
  60. FILE: Number of large read operations=0
  61. FILE: Number of write operations=0
  62. HDFS: Number of bytes read=253
  63. HDFS: Number of bytes written=220
  64. HDFS: Number of read operations=8
  65. HDFS: Number of large read operations=0
  66. HDFS: Number of write operations=4
  67. Job Counters
  68. Launched map tasks=2
  69. Other local map tasks=2
  70. Total time spent by all maps in occupied slots (ms)=29025
  71. Total time spent by all reduces in occupied slots (ms)=0
  72. Total time spent by all map tasks (ms)=29025
  73. Total vcore-milliseconds taken by all map tasks=29025
  74. Total megabyte-milliseconds taken by all map tasks=29721600
  75. Map-Reduce Framework
  76. Map input records=6
  77. Map output records=6
  78. Input split bytes=253
  79. Spilled Records=0
  80. Failed Shuffles=0
  81. Merged Map outputs=0
  82. GC time elapsed (ms)=417
  83. CPU time spent (ms)=2390
  84. Physical memory (bytes) snapshot=276865024
  85. Virtual memory (bytes) snapshot=3020857344
  86. Total committed heap usage (bytes)=121765888
  87. File Input Format Counters
  88. Bytes Read=0
  89. File Output Format Counters
  90. Bytes Written=220
  91. 18/12/09 07:00:07 INFO mapreduce.ImportJobBase: Transferred 220 bytes in 33.0333 seconds (6.66 bytes/sec)
  92. 18/12/09 07:00:07 INFO mapreduce.ImportJobBase: Retrieved 6 records.
  93. 18/12/09 07:00:07 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `customer2` AS t LIMIT 1
  94. 18/12/09 07:00:07 INFO hive.HiveImport: Loading uploaded data into Hive
  95.  
  96. Logging initialized using configuration in jar:file:/usr/lib/hive/lib/hive-common-1.1.0-cdh5.12.0.jar!/hive-log4j.properties
  97. OK
  98. Time taken: 3.016 seconds
  99. Loading data to table sumitpawar.customer2 partition (customer_city=CA)
  100. Partition sumitpawar.customer2{customer_city=CA} stats: [numFiles=2, numRows=0, totalSize=440, rawDataSize=0]
  101. OK
  102. Time taken: 1.056 seconds
  103.  
  104. hive (sumitpawar)> select * from customer2;
  105. OK
  106. +-------------+----------------+----------------+----------------+----------- --------+-----------------+---------------+----------------+------------------+
  107. | customer_id | customer_fname | customer_lname | customer_email | customer_password | customer_street | customer_city | customer_state | customer_zipcode |
  108. +-------------+----------------+----------------+----------------+-------------------+-----------------+---------------+----------------+------------------+
  109. | NULL | NULL | NULL | NULL | NULL |NULL | NULL | NULL | NULL |
Add Comment
Please, Sign In to add comment