Uploaded image for project: 'Sqoop (READ-ONLY)'
  1. Sqoop (READ-ONLY)
  2. SQOOP-174

Free-form Query Imports does not support alias_name

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: import
    • Labels:
      None

      Description

      Log output:
      /04/01 15:16:28 DEBUG sqoop.ConnFactory: Loaded manager factory: com.cloudera.sqoop.manager.DefaultManagerFactory
      11/04/01 15:16:28 DEBUG sqoop.ConnFactory: Trying ManagerFactory: com.cloudera.sqoop.manager.DefaultManagerFactory
      11/04/01 15:16:28 DEBUG manager.DefaultManagerFactory: Trying with scheme: jdbc:mysql:
      11/04/01 15:16:28 DEBUG sqoop.ConnFactory: Instantiated ConnManager com.cloudera.sqoop.manager.MySQLManager@32bf7190
      11/04/01 15:16:28 INFO tool.CodeGenTool: Beginning code generation
      11/04/01 15:16:29 INFO manager.MySQLManager: Executing SQL statement: SELECT f._id, s.url as site, f.url as_feed_url,s.language,gn.country_code, s.type as media_type FROM feed as f JOIN source as s ON f.source_id = s.id LEFT outer JOIN link_source_geoname as lsg ON s.id = lsg.source_id LEFT JOIN `geoname`.`geonames` as gn ON lsg.geoname_id = gn.geoname_id and lsg.type = 2 where (1 = 0) GROUP BY f._id ORDER BY f._id
      11/04/01 15:16:29 INFO manager.MySQLManager: Executing SQL statement: SELECT f._id, s.url as site, f.url as_feed_url,s.language,gn.country_code, s.type as media_type FROM feed as f JOIN source as s ON f.source_id = s.id LEFT outer JOIN link_source_geoname as lsg ON s.id = lsg.source_id LEFT JOIN `geoname`.`geonames` as gn ON lsg.geoname_id = gn.geoname_id and lsg.type = 2 where (1 = 0) GROUP BY f._id ORDER BY f._id
      11/04/01 15:16:29 DEBUG orm.ClassWriter: selected columns:
      11/04/01 15:16:29 DEBUG orm.ClassWriter: _id
      11/04/01 15:16:29 DEBUG orm.ClassWriter: url
      11/04/01 15:16:29 DEBUG orm.ClassWriter: url
      11/04/01 15:16:29 DEBUG orm.ClassWriter: language
      11/04/01 15:16:29 DEBUG orm.ClassWriter: country_code
      11/04/01 15:16:29 DEBUG orm.ClassWriter: type
      11/04/01 15:16:29 DEBUG orm.ClassWriter: Writing source file: /tmp/sqoop-hdfs/compile/9d80bb261d178f6ba0a0233fd0fabf4e/com/xxx/mapred/hbase/populate/mapper/QueryResult.java

      ...
      Exception trace:
      /tmp/sqoop-hdfs/compile/9d80bb261d178f6ba0a0233fd0fabf4e/com/xxx/mapred/hbase/populate/mapper/QueryResult.java:46: url is already defined in com.xxx.mapred.hbase.populate.mapper.QueryResult
      private String url;
      ^
      /tmp/sqoop-hdfs/compile/9d80bb261d178f6ba0a0233fd0fabf4e/com/xxx/mapred/hbase/populate/mapper/QueryResult.java:47: get_url() is already defined in com.xxx.mapred.hbase.populate.mapper.QueryResult
      public String get_url() {

      The alias_names used within free-form query e.g. 'f.url as feed_url' and 's.url as site' are not interpeted anymore (sqoop 1.1.0 did it correctly). The selected columns are:

      11/04/01 15:16:29 DEBUG orm.ClassWriter: selected columns:
      11/04/01 15:16:29 DEBUG orm.ClassWriter: _id
      11/04/01 15:16:29 DEBUG orm.ClassWriter: url
      11/04/01 15:16:29 DEBUG orm.ClassWriter: url
      11/04/01 15:16:29 DEBUG orm.ClassWriter: language
      11/04/01 15:16:29 DEBUG orm.ClassWriter: country_code
      11/04/01 15:16:29 DEBUG orm.ClassWriter: type

      and this will lead to the compile error in com.xxx.mapred.hbase.populate.mapper.QueryResult.java since url is duplicated field now.

      I use this version:

      Sqoop 1.2.0-CDH3B4
      git commit id efbfd13d6534623aea524649998c17a86ec92a0d
      Compiled by hudson@ubuntu-slave02 on Mon Feb 21 12:40:16 PST 2011

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jpkoenig Jean-Pierre König
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: