sqoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Spadotto <dougspado...@gmail.com>
Subject Re: sqoop import: dumping the header
Date Wed, 08 Mar 2017 13:24:35 GMT
Hello Subba,

There isn't a direct way to do this and generate .csv files that I know of.

One idea is to import data in the Avro format, which comes with the schema.

References:
https://sqoop.apache.org/docs/1.4.2/SqoopUserGuide.html#_file_formats
https://www.cloudera.com/documentation/enterprise/5-5-x/topics/cdh_ig_sqoop.html

Regards,

Douglas

On Wed, Mar 8, 2017 at 9:00 AM, Subba Reddy <subba@3loq.com> wrote:

> Hi,
>
>
> We would like to use sqoop to import data from a database as a CSV. But we
> could not find any option that controls whether to print the header or not
> while writing to a CSV.
>
>
> Query used:
>
> $ sqoop import \
>
>     --connect jdbc:mysql://mysql.example.com/sqoop \
>
>     --username sqoop \
>
>     --password sqoop \
>
>     --query 'SELECT * from cities' \
>
>     --target-dir cities
>
>
> Could you please help us in dumping the header too? Because without the
> header, the dumped data would not be so useful.
>
>
> Thanks,
>
> subba
>
>


-- 
Visite: http://canseidesercowboy.wordpress.com/
Siga: @dougspadotto ou @excowboys
-----
Frodo: "I wish none of this had happened."
Gandalf: "So do all who live to see such times, but that is not for them to
decide. All we have to decide is what to do with the time that is given to
us."
-- Lord of the Rings: The Fellowship of the Ring (2001)

Mime
View raw message