You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by anil gupta <an...@gmail.com> on 2012/02/21 21:52:59 UTC

Unable to import Oracle table with error " Imported Failed: Attempted to generate class with no columns!"

Hi All,

I am using sqoop cdh3u3 along with Hadoop cdh3u2. I am trying to
import a Oracle table but i get the following error:
 "ERROR tool.ImportTool: Imported Failed: Attempted to generate class
with no columns!"

Here is the console snippet:
[root@namenode ~]# sudo -u hdfs sqoop import --connect
jdbc:oracle:thin:@dev_db:1521:RiskStg --username db_user --password
db_password --table import_table_name --target-dir /user/hdfs  --
verbose
12/02/21 09:50:47 DEBUG tool.BaseSqoopTool: Enabled debug logging.
12/02/21 09:50:47 WARN tool.BaseSqoopTool: Setting your password on
the command-line is insecure. Consider using -P instead.
12/02/21 09:50:47 DEBUG sqoop.ConnFactory: Loaded manager factory:
com.cloudera.sqoop.manager.DefaultManagerFactory
12/02/21 09:50:47 DEBUG sqoop.ConnFactory: Trying ManagerFactory:
com.cloudera.sqoop.manager.DefaultManagerFactory
12/02/21 09:50:47 DEBUG manager.DefaultManagerFactory: Trying with
scheme: jdbc:oracle:thin:@dev_db:1521
12/02/21 09:50:47 DEBUG manager.OracleManager$ConnCache: Instantiated
new connection cache.
12/02/21 09:50:47 INFO manager.SqlManager: Using default fetchSize of
1000
12/02/21 09:50:47 DEBUG sqoop.ConnFactory: Instantiated ConnManager
com.cloudera.sqoop.manager.OracleManager@1cb8deef
12/02/21 09:50:47 INFO tool.CodeGenTool: Beginning code generation
12/02/21 09:50:47 DEBUG manager.OracleManager: Using column names
query: SELECT t.* FROM import_table_name t WHERE 1=0
12/02/21 09:50:47 DEBUG manager.OracleManager: Creating a new
connection for jdbc:oracle:thin:@dev_db:1521:RiskStg, using username:
db_user
12/02/21 09:50:47 DEBUG manager.OracleManager: No connection
paramenters specified. Using regular API for making connection.
12/02/21 09:50:48 INFO manager.OracleManager: Time zone has been set
to GMT
12/02/21 09:50:48 DEBUG manager.SqlManager: Using fetchSize for next
query: 1000
12/02/21 09:50:48 INFO manager.SqlManager: Executing SQL statement:
SELECT t.* FROM import_table_name t WHERE 1=0
12/02/21 09:50:48 DEBUG manager.OracleManager$ConnCache: Caching
released connection for jdbc:oracle:thin:@dev_db:1521:RiskStg/db_user
12/02/21 09:50:48 DEBUG orm.ClassWriter: selected columns:
12/02/21 09:50:48 ERROR tool.ImportTool: Imported Failed: Attempted to
generate class with no columns!

Also, I would like to know why sqoop is running a query which wont
return any rows viz. "SELECT t.* FROM import_table_name t WHERE 1=0"

Any help would be highly appreciated.
Thanks,
Anil

Re: Unable to import Oracle table with error " Imported Failed: Attempted to generate class with no columns!"

Posted by alo alt <wg...@googlemail.com>.
dependency: hadoop
   provider: hadoop-0.20.noarch 0.20.2+923.194-1

Which is shipped with CDH3u3. So update the cluster or downgrade sqoop (I assume you use the rpm's)

- Alex 

--
Alexander Lorenz
http://mapredit.blogspot.com

On Feb 21, 2012, at 12:52 PM, anil gupta wrote:

> I am using sqoop cdh3u3 along with Hadoop cdh3u2


Re: Unable to import Oracle table with error " Imported Failed: Attempted to generate class with no columns!"

Posted by anil gupta <an...@buffalo.edu>.
Hi Jarcec,

Your solution worked like a charm. Thank you so much.

On Tue, Feb 21, 2012 at 1:06 PM, Jarek Jarcec Cecho <ja...@apache.org>wrote:

> Hi Anil,
> unfortunately I do not have experience with Oracle, but there were plenty
> of issues regarding proper case in table names and user names. Would you
> mind trying uppercase table name? There is an explanation available on
> troubleshooting section on sqoop user guide:
>
>
> http://incubator.apache.org/sqoop/docs/1.4.1-incubating/SqoopUserGuide.html#_oracle_case_sensitive_catalog_query_errors
>
> To your last question, Sqoop is calling query that won't return anything
> to get table's metadata (column names, data types, ...) in database
> independent way.
>
> Jarcec
>
> On Tue, Feb 21, 2012 at 12:52:59PM -0800, anil gupta wrote:
> > Hi All,
> >
> > I am using sqoop cdh3u3 along with Hadoop cdh3u2. I am trying to
> > import a Oracle table but i get the following error:
> >  "ERROR tool.ImportTool: Imported Failed: Attempted to generate class
> > with no columns!"
> >
> > Here is the console snippet:
> > [root@namenode ~]# sudo -u hdfs sqoop import --connect
> > jdbc:oracle:thin:@dev_db:1521:RiskStg --username db_user --password
> > db_password --table import_table_name --target-dir /user/hdfs  --
> > verbose
> > 12/02/21 09:50:47 DEBUG tool.BaseSqoopTool: Enabled debug logging.
> > 12/02/21 09:50:47 WARN tool.BaseSqoopTool: Setting your password on
> > the command-line is insecure. Consider using -P instead.
> > 12/02/21 09:50:47 DEBUG sqoop.ConnFactory: Loaded manager factory:
> > com.cloudera.sqoop.manager.DefaultManagerFactory
> > 12/02/21 09:50:47 DEBUG sqoop.ConnFactory: Trying ManagerFactory:
> > com.cloudera.sqoop.manager.DefaultManagerFactory
> > 12/02/21 09:50:47 DEBUG manager.DefaultManagerFactory: Trying with
> > scheme: jdbc:oracle:thin:@dev_db:1521
> > 12/02/21 09:50:47 DEBUG manager.OracleManager$ConnCache: Instantiated
> > new connection cache.
> > 12/02/21 09:50:47 INFO manager.SqlManager: Using default fetchSize of
> > 1000
> > 12/02/21 09:50:47 DEBUG sqoop.ConnFactory: Instantiated ConnManager
> > com.cloudera.sqoop.manager.OracleManager@1cb8deef
> > 12/02/21 09:50:47 INFO tool.CodeGenTool: Beginning code generation
> > 12/02/21 09:50:47 DEBUG manager.OracleManager: Using column names
> > query: SELECT t.* FROM import_table_name t WHERE 1=0
> > 12/02/21 09:50:47 DEBUG manager.OracleManager: Creating a new
> > connection for jdbc:oracle:thin:@dev_db:1521:RiskStg, using username:
> > db_user
> > 12/02/21 09:50:47 DEBUG manager.OracleManager: No connection
> > paramenters specified. Using regular API for making connection.
> > 12/02/21 09:50:48 INFO manager.OracleManager: Time zone has been set
> > to GMT
> > 12/02/21 09:50:48 DEBUG manager.SqlManager: Using fetchSize for next
> > query: 1000
> > 12/02/21 09:50:48 INFO manager.SqlManager: Executing SQL statement:
> > SELECT t.* FROM import_table_name t WHERE 1=0
> > 12/02/21 09:50:48 DEBUG manager.OracleManager$ConnCache: Caching
> > released connection for jdbc:oracle:thin:@dev_db:1521:RiskStg/db_user
> > 12/02/21 09:50:48 DEBUG orm.ClassWriter: selected columns:
> > 12/02/21 09:50:48 ERROR tool.ImportTool: Imported Failed: Attempted to
> > generate class with no columns!
> >
> > Also, I would like to know why sqoop is running a query which wont
> > return any rows viz. "SELECT t.* FROM import_table_name t WHERE 1=0"
> >
> > Any help would be highly appreciated.
> > Thanks,
> > Anil
>



-- 
Thanks & Regards,
Anil Gupta

Re: Unable to import Oracle table with error " Imported Failed: Attempted to generate class with no columns!"

Posted by Jarek Jarcec Cecho <ja...@apache.org>.
Hi Anil,
unfortunately I do not have experience with Oracle, but there were plenty of issues regarding proper case in table names and user names. Would you mind trying uppercase table name? There is an explanation available on troubleshooting section on sqoop user guide:

http://incubator.apache.org/sqoop/docs/1.4.1-incubating/SqoopUserGuide.html#_oracle_case_sensitive_catalog_query_errors

To your last question, Sqoop is calling query that won't return anything to get table's metadata (column names, data types, ...) in database independent way.

Jarcec

On Tue, Feb 21, 2012 at 12:52:59PM -0800, anil gupta wrote:
> Hi All,
> 
> I am using sqoop cdh3u3 along with Hadoop cdh3u2. I am trying to
> import a Oracle table but i get the following error:
>  "ERROR tool.ImportTool: Imported Failed: Attempted to generate class
> with no columns!"
> 
> Here is the console snippet:
> [root@namenode ~]# sudo -u hdfs sqoop import --connect
> jdbc:oracle:thin:@dev_db:1521:RiskStg --username db_user --password
> db_password --table import_table_name --target-dir /user/hdfs  --
> verbose
> 12/02/21 09:50:47 DEBUG tool.BaseSqoopTool: Enabled debug logging.
> 12/02/21 09:50:47 WARN tool.BaseSqoopTool: Setting your password on
> the command-line is insecure. Consider using -P instead.
> 12/02/21 09:50:47 DEBUG sqoop.ConnFactory: Loaded manager factory:
> com.cloudera.sqoop.manager.DefaultManagerFactory
> 12/02/21 09:50:47 DEBUG sqoop.ConnFactory: Trying ManagerFactory:
> com.cloudera.sqoop.manager.DefaultManagerFactory
> 12/02/21 09:50:47 DEBUG manager.DefaultManagerFactory: Trying with
> scheme: jdbc:oracle:thin:@dev_db:1521
> 12/02/21 09:50:47 DEBUG manager.OracleManager$ConnCache: Instantiated
> new connection cache.
> 12/02/21 09:50:47 INFO manager.SqlManager: Using default fetchSize of
> 1000
> 12/02/21 09:50:47 DEBUG sqoop.ConnFactory: Instantiated ConnManager
> com.cloudera.sqoop.manager.OracleManager@1cb8deef
> 12/02/21 09:50:47 INFO tool.CodeGenTool: Beginning code generation
> 12/02/21 09:50:47 DEBUG manager.OracleManager: Using column names
> query: SELECT t.* FROM import_table_name t WHERE 1=0
> 12/02/21 09:50:47 DEBUG manager.OracleManager: Creating a new
> connection for jdbc:oracle:thin:@dev_db:1521:RiskStg, using username:
> db_user
> 12/02/21 09:50:47 DEBUG manager.OracleManager: No connection
> paramenters specified. Using regular API for making connection.
> 12/02/21 09:50:48 INFO manager.OracleManager: Time zone has been set
> to GMT
> 12/02/21 09:50:48 DEBUG manager.SqlManager: Using fetchSize for next
> query: 1000
> 12/02/21 09:50:48 INFO manager.SqlManager: Executing SQL statement:
> SELECT t.* FROM import_table_name t WHERE 1=0
> 12/02/21 09:50:48 DEBUG manager.OracleManager$ConnCache: Caching
> released connection for jdbc:oracle:thin:@dev_db:1521:RiskStg/db_user
> 12/02/21 09:50:48 DEBUG orm.ClassWriter: selected columns:
> 12/02/21 09:50:48 ERROR tool.ImportTool: Imported Failed: Attempted to
> generate class with no columns!
> 
> Also, I would like to know why sqoop is running a query which wont
> return any rows viz. "SELECT t.* FROM import_table_name t WHERE 1=0"
> 
> Any help would be highly appreciated.
> Thanks,
> Anil