You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by bejoy ks <be...@gmail.com> on 2012/02/21 19:56:50 UTC

Re: [sqoop-user] Unable to import Oracle table with error " Imported Failed: Attempted to generate class with no columns!"

Adding sqoop-user@incubator.apache.org, as sqoop-user@cloudera.org is
deprecated. Please register to the same and continue the conversation there.

Anil
      From your logs SQOOP is unable to fetch/select the columns from your
oracle table 'import_table_name'
"12/02/21 09:50:48 DEBUG orm.ClassWriter: selected columns:"
If your oracle table looks good could you try import by explicitly
specifying --columns col1,col2

You can try the following options
-- specify driver explicitly using --driver
-- use oraoop

 "SELECT t.* FROM import_table_name t WHERE 1=0"
AFAIK The above query is used by SQOOP to fetch the columnNames of oracle
table.



Regards
Bejoy.K.S


On Tue, Feb 21, 2012 at 11:33 PM, anilgupta <an...@gmail.com> 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
>
> --
> NOTE: The mailing list sqoop-user@cloudera.org is deprecated in favor of
> Apache Sqoop mailing list sqoop-user@incubator.apache.org. Please
> subscribe to it by sending an email to
> incubator-sqoop-user-subscribe@apache.org.
>



-- 
Regards
       Bejoy