From e0dd5d9d1d7f59647679049d794e3b8354d7e52b Mon Sep 17 00:00:00 2001 From: Josh Walters Date: Mon, 5 Jun 2017 17:40:47 -0700 Subject: [PATCH] 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 --- superset/connectors/druid/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py index 951a58e57c..9add7b13d4 100644 --- a/superset/connectors/druid/models.py +++ b/superset/connectors/druid/models.py @@ -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()