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 2026/04/01 00:29:00 UTC
[jira] [Commented] (KYLIN-4245) SqlConverter returns wrong syntax SQL when SqlParser fails for JDBC source
[ https://issues.apache.org/jira/browse/KYLIN-4245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18070178#comment-18070178 ]
ASF GitHub Bot commented on KYLIN-4245:
---------------------------------------
codecov-commenter commented on PR #1179:
URL: https://github.com/apache/kylin/pull/1179#issuecomment-4166582088
## [Codecov](https://app.codecov.io/gh/apache/kylin/pull/1179?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 25.00%. Comparing base ([`fa4f72d`](https://app.codecov.io/gh/apache/kylin/commit/fa4f72d2b12a4e6da60674dfd706ac7ca5534657?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`422fd3c`](https://app.codecov.io/gh/apache/kylin/commit/422fd3ceb8f28782f0545b3fb013c61210caa460?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #1179 +/- ##
============================================
- Coverage 25.00% 25.00% -0.01%
- Complexity 6251 6255 +4
============================================
Files 1449 1449
Lines 88499 88536 +37
Branches 12373 12381 +8
============================================
+ Hits 22129 22135 +6
- Misses 64190 64223 +33
+ Partials 2180 2178 -2
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/kylin/pull/1179?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
> SqlConverter returns wrong syntax SQL when SqlParser fails for JDBC source
> --------------------------------------------------------------------------
>
> Key: KYLIN-4245
> URL: https://issues.apache.org/jira/browse/KYLIN-4245
> Project: Kylin
> Issue Type: Bug
> Components: Others
> Affects Versions: v2.6.4
> Reporter: Cheng Zhong
> Assignee: Yaqian Zhang
> Priority: Critical
> Fix For: v3.1.0, v2.6.6
>
>
> Last year ( 28 Nov 2018) a [change|https://github.com/apache/kylin/commit/4158d7b3b56cbeb3c10ec5c091c23334131616a5] have been made to SqlConverter, that replace backtick to double qoute when converting sql. sqlWriter is responsible to format it back to backtick after parsing.
> However, if something failed in during parsing or formating, the SQL (backtick replaced with double qoute) will be returned instead. This will cause failure in following Sqoop execution.
> Information:
> SQL of Cube:
> {code:sql}
> SELECT
> `COM_BASIC_INFO`.`COM_NAME` as `COM_BASIC_INFO_COM_NAME`
> ,`COM_BASIC_INFO`.`COM_ENAME` as `COM_BASIC_INFO_COM_ENAME`
> ,`COM_BASIC_INFO`.`SNAME` as `COM_BASIC_INFO_SNAME`
> ,`COM_BASIC_INFO`.`FIN_REPO_TYPE` as `COM_BASIC_INFO_FIN_REPO_TYPE`
> FROM `COM_DS`.`COM_BASIC_INFO` as `COM_BASIC_INFO`
> WHERE 1=1
> {code}
> SQL Submitted to Sqoop (Exactly the one after replace backtick with double qoute):
> {code:sql}
> SELECT "COM_BASIC_INFO"."COM_NAME" as "COM_BASIC_INFO_COM_NAME" ,"COM_BASIC_INFO"."COM_ENAME" as "COM_BASIC_INFO_COM_ENAME" ,"COM_BASIC_INFO"."SNAME" as "COM_BASIC_INFO_SNAME" ,"COM_BASIC_INFO"."FIN_REPO_TYPE" as "COM_BASIC_INFO_FIN_REPO_TYPE" FROM "COM_DS"."COM_BASIC_INFO" as "COM_BASIC_INFO" WHERE 1=1 AND (1 = 0)
> {code}
> Error Logs:
> {code}
> 2019-11-08 15:17:49,609 ERROR [http-bio-7070-exec-29] conv.SqlConverter:60 : Failed to default convert sql, will use the input: SELECT `COM_BASIC_INFO`.`COM_NAME` as `COM_BASIC_INFO_COM_NAME` ,`COM_BASIC_INFO`.`COM_ENAME` as `COM_BASIC_INFO_COM_ENAME` ,`COM_BASIC_INFO`.`SNAME` as `COM_BASIC_INFO_SNAME` ,`COM_BASIC_INFO`.`FIN_REPO_TYPE` as `COM_BASIC_INFO_FIN_REPO_TYPE` FROM `COM_DS`.`COM_BASIC_INFO` as `COM_BASIC_INFO` WHERE 1=1
> java.lang.IllegalStateException: java.sql.SQLSyntaxErrorException: SELECT command denied to user 'dbuser'@'db.ip.addr.1' for table 'tablename'
> at org.apache.kylin.sdk.datasource.adaptor.DefaultAdaptor.fixIdentifierCaseSensitve(DefaultAdaptor.java:277)
> at org.apache.kylin.sdk.datasource.framework.conv.DefaultConfiguer.fixIdentifierCaseSensitve(DefaultConfiguer.java:131)
> at org.apache.kylin.sdk.datasource.framework.conv.ConvSqlWriter.identifier(ConvSqlWriter.java:145)
> at org.apache.calcite.sql.SqlIdentifier.unparse(SqlIdentifier.java:298)
> at org.apache.calcite.sql.SqlAsOperator.unparse(SqlAsOperator.java:76)
> at org.apache.calcite.sql.SqlDialect.unparseCall(SqlDialect.java:333)
> at org.apache.calcite.sql.dialect.MysqlSqlDialect.unparseCall(MysqlSqlDialect.java:155)
> at org.apache.calcite.sql.SqlCall.unparse(SqlCall.java:103)
> at org.apache.calcite.sql.SqlNodeList.commaList(SqlNodeList.java:121)
> at org.apache.calcite.sql.SqlOperator.unparseListClause(SqlOperator.java:349)
> at org.apache.calcite.sql.SqlOperator.unparseListClause(SqlOperator.java:338)
> at org.apache.calcite.sql.SqlSelectOperator.unparse(SqlSelectOperator.java:152)
> at org.apache.calcite.sql.SqlSelect.unparse(SqlSelect.java:237)
> at org.apache.calcite.sql.pretty.SqlPrettyWriter.format(SqlPrettyWriter.java:806)
> at org.apache.kylin.sdk.datasource.framework.conv.SqlConverter.convertSql(SqlConverter.java:58)
> at org.apache.kylin.sdk.datasource.framework.JdbcConnector.convertSql(JdbcConnector.java:84)
> at org.apache.kylin.source.jdbc.extensible.JdbcHiveInputBase$JDBCBaseBatchCubingInputSide.createSqoopToFlatHiveStep(JdbcHiveInputBase.java:79)
> at org.apache.kylin.source.jdbc.JdbcHiveInputBase$JdbcBaseBatchCubingInputSide.addStepPhase1_DoCreateFlatTable(JdbcHiveInputBase.java:65)
> at org.apache.kylin.source.hive.HiveInputBase$BaseBatchCubingInputSide.addStepPhase1_CreateFlatTable(HiveInputBase.java:83)
> at org.apache.kylin.engine.mr.BatchCubingJobBuilder2.build(BatchCubingJobBuilder2.java:59)
> at org.apache.kylin.engine.mr.MRBatchCubingEngine2.createBatchCubingJob(MRBatchCubingEngine2.java:42)
> at org.apache.kylin.engine.EngineFactory.createBatchCubingJob(EngineFactory.java:60)
> at org.apache.kylin.rest.service.JobService.submitJobInternal(JobService.java:234)
> at org.apache.kylin.rest.service.JobService.submitJob(JobService.java:202)
> at org.apache.kylin.rest.controller.CubeController.buildInternal(CubeController.java:395)
> at org.apache.kylin.rest.controller.CubeController.rebuild(CubeController.java:355)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)