You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Syed Akram <ak...@zohocorp.com> on 2015/02/09 13:56:21 UTC

sqoop1 create-hive-table for multiple tables Not working

Hi,


Iam trying to do sqoop create-hive-table for one db which have 600 tables, sequentially.
But only first table of that db, schema is created in hive, other tables schemas are not being created in hive. and no error message showing where iam going wrong.


below java code i'm using to do that




 
for (int i=0;i&lt;tables.size();i++){
      String[] str = {"create-hive-table", "--connect", jdbc:mysql://myip:port, "--table", tableName,
                    "--hive-table", db+"."+tableName, "--fields-terminated-by", ",",
                    "--username", "username", "--password", "password"};
      Sqoop.runTool(str);

}
Please tell me where iam going wrong




Thanks






Re: sqoop1 create-hive-table for multiple tables Not working

Posted by Syed Akram <ak...@zohocorp.com>.
I'm trying to call the command line from java, Do u have any snippet, please provide it.
Thank u Abe

---- On Tue, 10 Feb 2015 11:03:11 +0530 Abraham Elmahrek&lt;abe@cloudera.com&gt; wrote ---- 

There isn't one using Sqoop2 yet. We're working on Hive integration through Kite.

Have you tried to call the command line from Java?


On Mon, Feb 9, 2015 at 9:12 PM, Syed Akram &lt;akram.basha@zohocorp.com&gt; wrote:
Yes, i ran sqoop through command line. Through command line there was no problem, Only problem using java to run sqoop?

Is there any solution using sqoop2. Please let me know how can i do this.


Thanks


---- On Tue, 10 Feb 2015 02:02:57 +0530 Abraham Elmahrek&lt;abe@cloudera.com&gt; wrote ---- 

Hey Syed,

Have you tried about running Sqoop via the command line or as a bash script instead?


-Abe


On Mon, Feb 9, 2015 at 4:59 AM, Syed Akram &lt;akram.basha@zohocorp.com&gt; wrote:
edit:            
String db = "dbname"; 
for (int i=0;i&lt;tables.size();i++){
      String tableName = tables.get(i);
      String[] str = {"create-hive-table", "--connect", jdbc:mysql://myip:port, "--table", tableName,
                    "--hive-table", db+"."+tableName, "--fields-terminated-by", ",",
                    "--username", "username", "--password", "password"};
      Sqoop.runTool(str);

} 




---- On Mon, 09 Feb 2015 18:26:21 +0530 Syed Akram&lt;akram.basha@zohocorp.com&gt; wrote ---- 

Hi,


Iam trying to do sqoop create-hive-table for one db which have 600 tables, sequentially.
But only first table of that db, schema is created in hive, other tables schemas are not being created in hive. and no error message showing where iam going wrong.


below java code i'm using to do that




 
for (int i=0;i&lt;tables.size();i++){
      String[] str = {"create-hive-table", "--connect", jdbc:mysql://myip:port, "--table", tableName,
                    "--hive-table", db+"."+tableName, "--fields-terminated-by", ",",
                    "--username", "username", "--password", "password"};
      Sqoop.runTool(str);

}
Please tell me where iam going wrong




Thanks

















 











 







Re: sqoop1 create-hive-table for multiple tables Not working

Posted by Abraham Elmahrek <ab...@cloudera.com>.
There isn't one using Sqoop2 yet. We're working on Hive integration through
Kite.

Have you tried to call the command line from Java?

On Mon, Feb 9, 2015 at 9:12 PM, Syed Akram <ak...@zohocorp.com> wrote:

> Yes, i ran sqoop through command line. Through command line there was no
> problem, Only problem using java to run sqoop?
>
> Is there any solution using sqoop2. Please let me know how can i do this.
>
> Thanks
>
>
> ---- On Tue, 10 Feb 2015 02:02:57 +0530 *Abraham
> Elmahrek<abe@cloudera.com <ab...@cloudera.com>>* wrote ----
>
> Hey Syed,
>
> Have you tried about running Sqoop via the command line or as a bash
> script instead?
>
> -Abe
>
> On Mon, Feb 9, 2015 at 4:59 AM, Syed Akram <ak...@zohocorp.com>
> wrote:
>
> edit:
>
>
> *String db = "dbname"; *
> *for (int i=0;i<tables.size();i++)*
> *{*
>
> *String tableName = tables.get(i);*
> *      String[] str = {"create-hive-table", "--connect",
> jdbc:mysql://myip:port, "--table", tableName,*
> *                    "--hive-table", db+"."+tableName,
> "--fields-terminated-by", ",",*
> *                    "--username", "username", "--password", "password"};*
> *      Sqoop.runTool(str);*
> *}*
>
>
>
> ---- On Mon, 09 Feb 2015 18:26:21 +0530 *Syed
> Akram<akram.basha@zohocorp.com <ak...@zohocorp.com>>* wrote ----
>
> Hi,
>
> Iam trying to do sqoop create-hive-table for one db which have 600 tables,
> sequentially.
> But only first table of that db, schema is created in hive, other tables
> schemas are not being created in hive. and no error message showing where
> iam going wrong.
>
> below java code i'm using to do that
>
>
>
> *for (int i=0;i<tables.size();i++)*
>
> *{*
> *      String[] str = {"create-hive-table", "--connect",
> jdbc:mysql://myip:port, "--table", tableName,*
> *                    "--hive-table", db+"."+tableName,
> "--fields-terminated-by", ",",*
> *                    "--username", "username", "--password", "password"};*
> *      Sqoop.runTool(str);*
> *}*
>
> Please tell me where iam going wrong
>
>
> Thanks
>
>
>
>
>
>
>
>
>

Re: sqoop1 create-hive-table for multiple tables Not working

Posted by Syed Akram <ak...@zohocorp.com>.
Yes, i ran sqoop through command line. Through command line there was no problem, Only problem using java to run sqoop?

Is there any solution using sqoop2. Please let me know how can i do this.


Thanks


---- On Tue, 10 Feb 2015 02:02:57 +0530 Abraham Elmahrek&lt;abe@cloudera.com&gt; wrote ---- 

Hey Syed,

Have you tried about running Sqoop via the command line or as a bash script instead?


-Abe


On Mon, Feb 9, 2015 at 4:59 AM, Syed Akram &lt;akram.basha@zohocorp.com&gt; wrote:
edit:            
String db = "dbname"; 
for (int i=0;i&lt;tables.size();i++){
      String tableName = tables.get(i);
      String[] str = {"create-hive-table", "--connect", jdbc:mysql://myip:port, "--table", tableName,
                    "--hive-table", db+"."+tableName, "--fields-terminated-by", ",",
                    "--username", "username", "--password", "password"};
      Sqoop.runTool(str);

} 




---- On Mon, 09 Feb 2015 18:26:21 +0530 Syed Akram&lt;akram.basha@zohocorp.com&gt; wrote ---- 

Hi,


Iam trying to do sqoop create-hive-table for one db which have 600 tables, sequentially.
But only first table of that db, schema is created in hive, other tables schemas are not being created in hive. and no error message showing where iam going wrong.


below java code i'm using to do that




 
for (int i=0;i&lt;tables.size();i++){
      String[] str = {"create-hive-table", "--connect", jdbc:mysql://myip:port, "--table", tableName,
                    "--hive-table", db+"."+tableName, "--fields-terminated-by", ",",
                    "--username", "username", "--password", "password"};
      Sqoop.runTool(str);

}
Please tell me where iam going wrong




Thanks

















 






Re: sqoop1 create-hive-table for multiple tables Not working

Posted by Abraham Elmahrek <ab...@cloudera.com>.
Hey Syed,

Have you tried about running Sqoop via the command line or as a bash script
instead?

-Abe

On Mon, Feb 9, 2015 at 4:59 AM, Syed Akram <ak...@zohocorp.com> wrote:

> edit:
>
>
> *String db = "dbname"; *
> *for (int i=0;i<tables.size();i++)*
> *{*
>
> *String tableName = tables.get(i);*
> *      String[] str = {"create-hive-table", "--connect",
> jdbc:mysql://myip:port, "--table", tableName,*
> *                    "--hive-table", db+"."+tableName,
> "--fields-terminated-by", ",",*
> *                    "--username", "username", "--password", "password"};*
> *      Sqoop.runTool(str);*
> *}*
>
>
>
> ---- On Mon, 09 Feb 2015 18:26:21 +0530 *Syed
> Akram<akram.basha@zohocorp.com <ak...@zohocorp.com>>* wrote ----
>
> Hi,
>
> Iam trying to do sqoop create-hive-table for one db which have 600 tables,
> sequentially.
> But only first table of that db, schema is created in hive, other tables
> schemas are not being created in hive. and no error message showing where
> iam going wrong.
>
> below java code i'm using to do that
>
>
>
> *for (int i=0;i<tables.size();i++)*
>
> *{*
> *      String[] str = {"create-hive-table", "--connect",
> jdbc:mysql://myip:port, "--table", tableName,*
> *                    "--hive-table", db+"."+tableName,
> "--fields-terminated-by", ",",*
> *                    "--username", "username", "--password", "password"};*
> *      Sqoop.runTool(str);*
> *}*
>
> Please tell me where iam going wrong
>
>
> Thanks
>
>
>
>
>
>

Re: sqoop1 create-hive-table for multiple tables Not working

Posted by Syed Akram <ak...@zohocorp.com>.
edit:            
String db = "dbname"; 
for (int i=0;i&lt;tables.size();i++){
      String tableName = tables.get(i);
      String[] str = {"create-hive-table", "--connect", jdbc:mysql://myip:port, "--table", tableName,
                    "--hive-table", db+"."+tableName, "--fields-terminated-by", ",",
                    "--username", "username", "--password", "password"};
      Sqoop.runTool(str);

} 




---- On Mon, 09 Feb 2015 18:26:21 +0530 Syed Akram&lt;akram.basha@zohocorp.com&gt; wrote ---- 

Hi,


Iam trying to do sqoop create-hive-table for one db which have 600 tables, sequentially.
But only first table of that db, schema is created in hive, other tables schemas are not being created in hive. and no error message showing where iam going wrong.


below java code i'm using to do that




 
for (int i=0;i&lt;tables.size();i++){
      String[] str = {"create-hive-table", "--connect", jdbc:mysql://myip:port, "--table", tableName,
                    "--hive-table", db+"."+tableName, "--fields-terminated-by", ",",
                    "--username", "username", "--password", "password"};
      Sqoop.runTool(str);

}
Please tell me where iam going wrong




Thanks