Hi,

This is a bug; In the before it can keep the data of the intermediate
table, that is helpful for troubleshooting. Could you please report a JIRA?

If you need to keep the intermediate table in one table, you can modify
Kylin code, but I suggest you to write some shell scripts to do that (just
moving the data to another location).

Thanks for the reporting!

在 2018年8月31日 上午10:46,笑忘江湖 <[email protected]>写道:

> 各位老师好,
>      项目组准备使用kylin,遇到一个问题想咨询下,kylin.source.hive.keep-flat-
> table这个参数设置为true后,只是保留了hive表结构,但是数据还是被清除了,查看了源码,
> 这个参数确实只是对表结构进行控制,请问下这么做的目的是什么,我希望数据也可以保存下来。
> 如果我希望数据也保存下来,并且是一个cube下面所有作业的数据都保存到一个表里面,我是否要做相应代码修改,添加代码把数据保存到对应表,
> 各位老师是否有更好的建议或方法。谢谢。
>
>
> 源码如下:
>  private String cleanUpIntermediateFlatTable(KylinConfig config) throws
> IOException {
>             StringBuffer output = new StringBuffer();
>             final HiveCmdBuilder hiveCmdBuilder = new HiveCmdBuilder();
>             final List<String> hiveTables = this.getIntermediateTables();
>             for (String hiveTable : hiveTables) {
>                 if (config.isHiveKeepFlatTable() == false &&
> StringUtils.isNotEmpty(hiveTable)) {
>                     hiveCmdBuilder.addStatement("USE " + config.
> getHiveDatabaseForIntermediateTable() + ";");
>                     hiveCmdBuilder.addStatement("DROP TABLE IF EXISTS  "
> + hiveTable + ";");
>
>
>                     output.append("Hive table " + hiveTable + " is
> dropped. \n");
>                 }
>             }
>             config.getCliCommandExecutor().execute(hiveCmdBuilder.build(
> ));
>             rmdirOnHDFS(getExternalDataPaths());
>             output.append("Path " + getExternalDataPaths() + " is deleted.
> \n");
>
>
>             return output.toString();
>         }




-- 
Best regards,

Shaofeng Shi 史少锋

Reply via email to