Removed __time column from druid metadata refresh, added long and double schema support (#2911)

* Removed __time column from load, added long/double schema support

* Format fix
This commit is contained in:
Josh Walters 2017-06-05 17:40:47 -07:00 committed by Maxime Beauchemin
parent 737db25b6e
commit e0dd5d9d1d
1 changed files with 8 additions and 0 deletions

View File

@ -603,6 +603,9 @@ class DruidDatasource(Model, BaseDatasource):
logging.error("Failed at fetching the latest segment")
return
for col in cols:
# Skip the time column
if col == "__time":
continue
col_obj = (
session
.query(DruidColumn)
@ -618,6 +621,11 @@ class DruidDatasource(Model, BaseDatasource):
col_obj.filterable = True
if datatype == "hyperUnique" or datatype == "thetaSketch":
col_obj.count_distinct = True
# If long or double, allow sum/min/max
if datatype == "LONG" or datatype == "DOUBLE":
col_obj.sum = True
col_obj.min = True
col_obj.max = True
if col_obj:
col_obj.type = cols[col]['type']
session.flush()