You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/04/18 13:36:00 UTC

[jira] [Commented] (KYLIN-3857) Add parameter to change sql quoting character for sqoop

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

ASF GitHub Bot commented on KYLIN-3857:
---------------------------------------

nichunen commented on pull request #507: KYLIN-3857 Disable quote when needed
URL: https://github.com/apache/kylin/pull/507
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Add parameter to change sql quoting character for sqoop
> -------------------------------------------------------
>
>                 Key: KYLIN-3857
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3857
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: Davide Malagoli
>            Assignee: XiaoXiang Yu
>            Priority: Major
>             Fix For: v2.6.2
>
>         Attachments: image-2019-03-11-11-46-05-946.png, image-2019-03-11-11-46-14-305.png, image-2019-03-11-11-46-20-664.png, image-2019-03-11-11-46-31-966.png, sqoop-error.log, sqoop-script.sh
>
>
> I've set up  Kylin to access a SQL server using JDBC and do the ETL step as described in
> [http://kylin.apache.org/docs/tutorial/setup_jdbc_datasource.html]
> but when the "Sqoop To Flat Hive Table" runs it terminates with an error shown in the attached log.
> It seems that the root cause is the presence of the '`' character in the query, which has no meaning for sql server.
>  
> My problem seems to related to this piece of code
>  
> public class FlatTableSqlQuoteUtils {
> public static final String QUOTE = "`";
> /**
>  * Quote identifier by default quote `
>  * @param identifier
>  * @return
>  */
>  public static String quoteIdentifier(String identifier){
>  return QUOTE + identifier + QUOTE;
>  }
>  
> The solution may be to add a parameter to change this character used for quoting.
>  
> Just to be sure I made a copy of the original "sqoop" command to "sqoop.orig" and replaced the original with a little script of mine (attached).
> This little script removes the "`" character from the original command and the call "sqoop.orig" with the cleaned arguments.
> It works, but it is still an ugly workaround.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)