sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SQOOP-2864) ClassWriter chokes on column names containing double quotes
Date Fri, 04 Mar 2016 20:46:40 GMT

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

Hudson commented on SQOOP-2864:
-------------------------------

FAILURE: Integrated in Sqoop-hadoop23 #1244 (See [https://builds.apache.org/job/Sqoop-hadoop23/1244/])
SQOOP-2864: ClassWriter chokes on column names containing double quotes  (venkat: [https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=152fe93002253b8b3e433d4193ad1e9d1c1591ba])
* src/java/org/apache/sqoop/orm/ClassWriter.java


> ClassWriter chokes on column names containing double quotes
> -----------------------------------------------------------
>
>                 Key: SQOOP-2864
>                 URL: https://issues.apache.org/jira/browse/SQOOP-2864
>             Project: Sqoop
>          Issue Type: Bug
>    Affects Versions: 1.4.6
>            Reporter: Jarek Jarcec Cecho
>            Assignee: Jarek Jarcec Cecho
>             Fix For: 1.4.7
>
>         Attachments: SQOOP-2864.patch
>
>
> I've seen a user who created table with column names containing double quotes and while
code generation, we quite spectacularly failed:
> {code}
> 16/03/02 12:14:13 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/lib/hadoop-mapreduce
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:325: error: ')' expected
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                             ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:325: error: not a
statement
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                                   ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:325: error: ';' expected
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                                     ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:325: error: not a
statement
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                                            ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:325: error: ';' expected
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                                                    ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:332: error: ')' expected
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                             ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:332: error: not a
statement
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                                   ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:332: error: ';' expected
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                                     ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:332: error: not a
statement
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                                            ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:332: error: ';' expected
>     __sqoop$field_map.put(""tellmewhy"", this._tellmewhy_);
>                                                    ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:340: error: ')' expected
>     else    if (""tellmewhy"".equals(__fieldName)) {
>                   ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:340: error: ';' expected
>     else    if (""tellmewhy"".equals(__fieldName)) {
>                         ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:340: error: ';' expected
>     else    if (""tellmewhy"".equals(__fieldName)) {
>                                               ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:343: error: 'else'
without 'if'
>     else    if ("'single'".equals(__fieldName)) {
>     ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:355: error: ')' expected
>     else    if (""tellmewhy"".equals(__fieldName)) {
>                   ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:355: error: ';' expected
>     else    if (""tellmewhy"".equals(__fieldName)) {
>                         ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:355: error: ';' expected
>     else    if (""tellmewhy"".equals(__fieldName)) {
>                                               ^
> /tmp/sqoop-root/compile/60f084d5441147b848b007d2a18b504d/bofa.java:359: error: 'else'
without 'if'
>     else    if ("'single'".equals(__fieldName)) {
>     ^
> 18 errors
> 16/03/02 12:14:14 ERROR tool.ImportTool: Encountered IOException running import job:
java.io.IOException: Error returned by javac
>   at org.apache.sqoop.orm.CompilationManager.compile(CompilationManager.java:217)
>   at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:108)
>   at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:488)
>   at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:615)
>   at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
>   at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
>   at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
>   at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
>   at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
>   at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
> {code}
> I've looked into it and the problem is that we've started preserving raw column names
inside the generated class, but we did not escape properly the case when the column name contain
double quotes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message