You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Swaroop Patra <sw...@gmail.com> on 2013/09/26 08:49:14 UTC
Create hive tables dynamically from pig script
Hi All,
I have a requirement to create hive tables dynamically from pig script.
Idea is while executing pig script we generate some intermediate data which
we want to store in to hive tables. Schema for this data may vary for each
execution. I am looking for a way in which I can create hive tables
dynamically from pig script and load data to those tables from pig script.
Is this possible? Please help.
Hadoop version - 0.20.2-cdh3u2
Pig version - 0.9.2
Hive version - 0.8.0
Thanks & Regards,
Swaroop
Re: Create hive tables dynamically from pig script
Posted by Ruslan Al-Fakikh <me...@gmail.com>.
Probably you'll need Pig embedding:
http://pig.apache.org/docs/r0.11.1/cont.html
For doing some logic that is not MapReduce and depends on you Pig's output.
For loading data to the created tables, you can take a look at HCatalog,
though I am not sure whether your very old version of the Hadoop distro
supports it:(
Thanks
On Thu, Sep 26, 2013 at 10:49 AM, Swaroop Patra <sw...@gmail.com>wrote:
> Hi All,
>
> I have a requirement to create hive tables dynamically from pig script.
> Idea is while executing pig script we generate some intermediate data which
> we want to store in to hive tables. Schema for this data may vary for each
> execution. I am looking for a way in which I can create hive tables
> dynamically from pig script and load data to those tables from pig script.
> Is this possible? Please help.
>
> Hadoop version - 0.20.2-cdh3u2
> Pig version - 0.9.2
> Hive version - 0.8.0
>
> Thanks & Regards,
> Swaroop
>