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

Shaofeng SHI commented on KYLIN-915:
------------------------------------

Two possible cases can cause null be returned:
1) multiple tables having the same name (for example, table DEFAULT.USER and 
EDW.USER);
2) the table was dropped from metadata /table folder, but still be referred 
somewhere else (like project, cube, etc);

for case 1): actually it will not happen, as 0.6 doesn't support this case; All 
tables are put in /table/ folder with the table name as file name (no database 
name);

for case 2): on 1 possible case: user hard-drop the table from resource store, 
as Kylin UI doesn't allow user to drop a hive table definition;  In this case 
any cube/project that referes to this table should do a cleanup;

Updated the error message, and checking null in the place that adding it to 
project instance;  

> appendDBName in CubeMetadataUpgrade will return null
> ----------------------------------------------------
>
>                 Key: KYLIN-915
>                 URL: https://issues.apache.org/jira/browse/KYLIN-915
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: hongbin ma
>            Assignee: Shaofeng SHI
>
> In current implementation, appendDBName will return null if more than one 
> tables share the table name. The caller is not aware of this, and will put 
> null values into project/cube instance, this will cause runtime errors.
>   if (count == 1)
>             return result;
>         if (count > 1) {
>             errorMsgs.add("There are more than 1 table named with '" + table 
> + "' in different database; The program couldn't determine, randomly pick '" 
> + result + "'");
>         }
>         if (count == 0) {
>             errorMsgs.add("There is no table named with '" + table + "'");
>         }
>         return result;



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

Reply via email to