Dong Li created KYLIN-2440: ------------------------------ Summary: Query failed if join condition columns not appear on cube Key: KYLIN-2440 URL: https://issues.apache.org/jira/browse/KYLIN-2440 Project: Kylin Issue Type: Bug Reporter: Dong Li Assignee: liyang
The metadata are: The model is: KYLIN_SALES(fact) - KYLIN_ACCOUNT(fact) - KYLIN_COUNTRY(lookup) Dimensions on cube: KYLIN_SALES.PART_DT(Normal), KYLIN_COUNTRY.LONGITUDE(derived) The failed query: SELECT count(*) FROM KYLIN_SALES as KYLIN_SALES INNER JOIN KYLIN_ACCOUNT as KYLIN_ACCOUNT ON KYLIN_SALES.SELLER_ID = KYLIN_ACCOUNT.ACCOUNT_ID INNER JOIN KYLIN_COUNTRY as KYLIN_COUNTRY ON KYLIN_ACCOUNT.ACCOUNT_COUNTRY = KYLIN_COUNTRY.COUNTRY INNER JOIN KYLIN_ACCOUNT as KYLIN_ACCOUNT_B ON KYLIN_SALES.BUYER_ID = KYLIN_ACCOUNT_B.ACCOUNT_ID INNER JOIN KYLIN_COUNTRY as KYLIN_COUNTRY_B ON KYLIN_ACCOUNT_B.ACCOUNT_COUNTRY = KYLIN_COUNTRY_B.COUNTRY Query stacktrace: 2017-02-09 08:49:53,879 ERROR [Query 5a458124-6cae-47b8-8621-24173c1eeba1-101] runtime.CalciteException:59 : org.apache.calcite.sql.validate.SqlValidatorException: Column 'SELLER_ID' not found in ta ble 'KYLIN_SALES' 2017-02-09 08:49:53,880 ERROR [Query 5a458124-6cae-47b8-8621-24173c1eeba1-101] runtime.CalciteException:61 : org.apache.calcite.runtime.CalciteContextException: From line 4, column 16 to line 4, col umn 24: Column 'SELLER_ID' not found in table 'KYLIN_SALES' 2017-02-09 08:49:53,880 ERROR [Query 5a458124-6cae-47b8-8621-24173c1eeba1-101] service.QueryService:379 : Exception when execute sql java.sql.SQLException: Error while executing SQL "SELECT * FROM KYLIN_SALES as KYLIN_SALES INNER JOIN KYLIN_ACCOUNT as KYLIN_ACCOUNT ON KYLIN_SALES.SELLER_ID = KYLIN_ACCOUNT.ACCOUNT_ID INNER JOIN KYLIN_COUNTRY as KYLIN_COUNTRY ON KYLIN_ACCOUNT.ACCOUNT_COUNTRY = KYLIN_COUNTRY.COUNTRY INNER JOIN KYLIN_ACCOUNT as KYLIN_ACCOUNT_B ON KYLIN_SALES.BUYER_ID = KYLIN_ACCOUNT_B.ACCOUNT_ID INNER JOIN KYLIN_COUNTRY as KYLIN_COUNTRY_B ON KYLIN_ACCOUNT_B.ACCOUNT_COUNTRY = KYLIN_COUNTRY_B.COUNTRY LIMIT 50000": From line 4, column 16 to line 4, column 24: Column 'SELLER_ID' not found in table 'KYLIN_SALES' at org.apache.calcite.avatica.Helper.createException(Helper.java:56) at org.apache.calcite.avatica.Helper.createException(Helper.java:41) at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156) at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:218) at org.apache.kylin.rest.service.QueryService.execute(QueryService.java:557) at org.apache.kylin.rest.service.QueryService.queryWithSqlMassage(QueryService.java:461) .... Caused by: org.apache.calcite.runtime.CalciteContextException: From line 4, column 16 to line 4, column 24: Column 'SELLER_ID' not found in table 'KYLIN_SALES' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463) at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:796) at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:784) at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:4080) at org.apache.calcite.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:362) at org.apache.calcite.sql.validate.SqlValidatorImpl$Expander.visit(SqlValidatorImpl.java:4579) at org.apache.calcite.sql.validate.SqlValidatorImpl$Expander.visit(SqlValidatorImpl.java:4561) at org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:334) at org.apache.calcite.sql.util.SqlShuttle$CallCopyingArgHandler.visitChild(SqlShuttle.java:134) at org.apache.calcite.sql.util.SqlShuttle$CallCopyingArgHandler.visitChild(SqlShuttle.java:101) .... Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Column 'SELLER_ID' not found in table 'KYLIN_SALES' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463) at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:572) -- This message was sent by Atlassian JIRA (v6.3.15#6346)