1. 程式人生 > >superset和kylin搭配查不出資料的處理

superset和kylin搭配查不出資料的處理

公司使用superset和kylin的搭配已經有一段時間了,關於superset和kylin搭配查不出資料的處理需要重點記錄一下,避免下次忘記

1、count關鍵字問題

count欄位是kylin的關鍵字,在superset中,簡單的方法是建議在Edit sqla Table中,將count改為count1就ok.

如果經常使用count欄位,建議修改pykylin外掛,實現對count的支援,這裡不介紹。


2、日期和時間格式問題

修改 db_engine_specs.py 檔案 class BaseEngineSpec(object):
@classmethod     def convert_dttm(cls, target_type, dttm):         return "'{}'".format(dttm.strftime('%Y-%m-%d %H-%M-%S')) 中的 %H-%M-%S 去掉並儲存就可以了 ***** 當然還有更好的解決方案,就是修改kylin原始碼,讓其支援'%Y-%m-%d %H-%M-%S'的解析,這裡就不介紹了。