sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bharath v (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SQOOP-1267) Add functionality to export a subset of columns ignoring columns other than the ones in "--columns" list
Date Wed, 15 Jan 2014 07:01:22 GMT
bharath v created SQOOP-1267:
--------------------------------

             Summary: Add functionality to export a subset of columns ignoring columns other
than the ones in "--columns" list
                 Key: SQOOP-1267
                 URL: https://issues.apache.org/jira/browse/SQOOP-1267
             Project: Sqoop
          Issue Type: Improvement
          Components: sqoop2-framework
    Affects Versions: 2.0.0
            Reporter: bharath v
            Priority: Minor


Currently we can export a subset of columns with --columns flag (SQOOP-503). However, other
columns are reported as NULLS in the final table. Instead we can add a flag that eliminates
the columns other than the ones in --columns flag. This way we can just export a subset of
columns ignoring others.

Example: 

Sample file is as follows:- 
12|jithin|aluva|good 
23|syam|aluva|good 
34|john|prbr|cool 
35|ramesh|ankly|fare 

MYSQL sample table is having the following schema:- 
| id | name | place | comments | 

we executed the sqoop command as :- 
sqoop export --connect jdbc:mysql://hostname/test --username uname -P --export-dir /user/johnj2/sqoopexport/
--input-fields-terminated-by '|' --table sqooptest --columns name,place 

Job went success and data is exported into mysql as follows :- 
+------+------+--------+----------+ 
| id | name | place | comments | 
+------+------+--------+----------+ 
| NULL | 35 | ramesh | NULL | 
| NULL | 12 | jithin | NULL | 
| NULL | 23 | syam | NULL | 
| NULL | 34 | john | NULL | 
+------+------+--------+----------+ 

Instead we can add a flag that ignores columns id and comments.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message