You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/05/15 02:57:41 UTC

[GitHub] [incubator-superset] david-z-johnson opened a new issue #7511: druid post aggregation KeyError for arithmetic division type

david-z-johnson opened a new issue #7511: druid post aggregation KeyError for arithmetic division type
URL: https://github.com/apache/incubator-superset/issues/7511
 
 
   added a customed post aggregation in superset, but got KeyError.
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: 0.28.1/0.29.0rc6 , install by pip
   - python version: 3.6.8
   
   
   ### Checklist
   
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version of superset.
   - [ ] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### callstack:
   
   2019-05-15 10:40:59,534:ERROR:root:'totalActionTimeMs'
   Traceback (most recent call last):
     File "/home/work/superset-venv/lib/python3.6/site-packages/superset/viz.py", line 406, in get_df_payload
       df = self.get_df(query_obj)
     File "/home/work/superset-venv/lib/python3.6/site-packages/superset/viz.py", line 211, in get_df
       self.results = self.datasource.query(query_obj)
     File "/home/work/superset-venv/lib/python3.6/site-packages/superset/connectors/druid/models.py", line 1342, in query
       client=client, query_obj=query_obj, phase=2)
     File "/home/work/superset-venv/lib/python3.6/site-packages/superset/connectors/druid/models.py", line 940, in get_query_str
       return self.run_query(client=client, phase=phase, **query_obj)
     File "/home/work/superset-venv/lib/python3.6/site-packages/superset/connectors/druid/models.py", line 1141, in run_query
       metrics_dict)
     File "/home/work/superset-venv/lib/python3.6/site-packages/superset/connectors/druid/models.py", line 903, in metrics_and_post_aggs
       postagg, post_aggs, saved_agg_names, visited_postaggs, metrics_dict)
     File "/home/work/superset-venv/lib/python3.6/site-packages/superset/connectors/druid/models.py", line 869, in resolve_postagg
       required_fields, metrics_dict)
     File "/home/work/superset-venv/lib/python3.6/site-packages/superset/connectors/druid/models.py", line 830, in find_postaggs_for
       metrics_dict[name] for name in postagg_names
     File "/home/work/superset-venv/lib/python3.6/site-packages/superset/connectors/druid/models.py", line 831, in <listcomp>
       if metrics_dict[name].metric_type == POST_AGG_TYPE
   KeyError: 'totalActionTimeMs'
   
   ### superset customed metric
   type: postagg
   json:
   {
       "type": "arithmetic",
       "name": "avgActionTimeInMs",
       "fn": "/",
       "fields": [
           {
               "type": "fieldAccess",
               "name": "totalActionTimeMs",
               "fieldName": "totalActionTimeMs"
           },
           {
               "type": "fieldAccess",
               "name": "countRows",
               "fieldName": "countRows"
           }
       ]
   }
   
   ### DRUID metic spec
   
           "metricsSpec": [
               {
                   "type": "count",
                   "name": "countRows"
               },
               {
                   "type" : "doubleSum",
                   "name" : "totalActionTimeMs",
                   "fieldName" : "actionTimeInMs"
               }
           ],

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org