sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Boyd (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SQOOP-332) Cannot use --as-avrodatafile with --query
Date Sat, 10 Sep 2011 00:14:09 GMT

    [ https://issues.apache.org/jira/browse/SQOOP-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101673#comment-13101673
] 

Joseph Boyd commented on SQOOP-332:
-----------------------------------

Looking at the code, it seems we need to pick a default name for the avro 'tableName' and
'name' properties when no table name is supplied, similar to how ClassWriter picks 'QueryResult'
for the java class name when no table name is supplied.

I've a quick, hack-ish patch that does this (which I'll attach), but it'd probably be best
for me to take another look at how ClassWriter picks its default class name and see if I can't
make the default that AvroSchemaGenerator picks match.


> Cannot use --as-avrodatafile with --query
> -----------------------------------------
>
>                 Key: SQOOP-332
>                 URL: https://issues.apache.org/jira/browse/SQOOP-332
>             Project: Sqoop
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.3.0
>            Reporter: Aaron Kimball
>
> Using sqoop with --as-avrodatafile and --query to specify a freeform query causes an
exception:
> {code}11/08/30 19:55:28 ERROR sqoop.Sqoop: Got exception running Sqoop: org.apache.avro.AvroRuntimeException:
Can't set a property to null: tableName
> org.apache.avro.AvroRuntimeException: Can't set a property to null: tableName
> 	at org.apache.avro.Schema$Props.add(Schema.java:124)
> 	at org.apache.avro.Schema.addProp(Schema.java:166)
> 	at com.cloudera.sqoop.orm.AvroSchemaGenerator.generate(AvroSchemaGenerator.java:69)
> 	at com.cloudera.sqoop.mapreduce.DataDrivenImportJob.configureMapper(DataDrivenImportJob.java:78)
> 	at com.cloudera.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:175)
> 	at com.cloudera.sqoop.manager.SqlManager.importQuery(SqlManager.java:442)
> 	at com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:352)
> 	at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:423)
> 	at com.cloudera.sqoop.Sqoop.run(Sqoop.java:144)
> 	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
> 	at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:180)
> 	at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:219)
> 	at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:228)
> 	at com.cloudera.sqoop.Sqoop.main(Sqoop.java:237){code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message