You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Chunky Gupta <ch...@vizury.com> on 2013/02/20 07:53:02 UTC

Need tab separated output file and put limit on number of lines in a output file

Hi,

Currently the output file columns of my query is separate by "^A", I need
my output to be separated by tab. Can anybody help me in setting this ?

I more doubt, I want to limit the number of lines in output files. For
example, I do not want any of my output file to be more than 1000 lines,
can I set this in configuration ?

Thanks,
Chunky.

Re: Need tab separated output file and put limit on number of lines in a output file

Posted by Chunky Gupta <ch...@vizury.com>.
Hi Mark,

We mostly do insert overwrite into local directory, and at that location
multiple files with output of that query are created and we use these files
our analysis. So, we want these files to be tab separated.

Limiting the number of records means limiting the length of a file, not
limiting the overall output. For example, suppose my queries output has
10000 lines, I want to put limit on length of a file to 1000 lines, so hive
should give me 10 files of 1000 lines each, is there any configuration for
this ?

Thanks,
Chunky.

On Wed, Feb 20, 2013 at 10:50 PM, Mark Grover
<gr...@gmail.com>wrote:

> Chunky,
> There may be another way to do this but to get tab separated output, I
> usually create an external table that's tab separated and insert
> overwrite into that table.
>
> For limiting the number of records in the output, you can use the
> limit clause in your query.
>
> Mark
>
> On Tue, Feb 19, 2013 at 10:53 PM, Chunky Gupta <ch...@vizury.com>
> wrote:
> > Hi,
> >
> > Currently the output file columns of my query is separate by "^A", I
> need my
> > output to be separated by tab. Can anybody help me in setting this ?
> >
> > I more doubt, I want to limit the number of lines in output files. For
> > example, I do not want any of my output file to be more than 1000 lines,
> can
> > I set this in configuration ?
> >
> > Thanks,
> > Chunky.
>

Re: Need tab separated output file and put limit on number of lines in a output file

Posted by Mark Grover <gr...@gmail.com>.
Chunky,
There may be another way to do this but to get tab separated output, I
usually create an external table that's tab separated and insert
overwrite into that table.

For limiting the number of records in the output, you can use the
limit clause in your query.

Mark

On Tue, Feb 19, 2013 at 10:53 PM, Chunky Gupta <ch...@vizury.com> wrote:
> Hi,
>
> Currently the output file columns of my query is separate by "^A", I need my
> output to be separated by tab. Can anybody help me in setting this ?
>
> I more doubt, I want to limit the number of lines in output files. For
> example, I do not want any of my output file to be more than 1000 lines, can
> I set this in configuration ?
>
> Thanks,
> Chunky.