superset icon indicating copy to clipboard operation
superset copied to clipboard

Error around the DECIMAL type in Presto

Open mistercrunch opened this issue 9 years ago • 2 comments

No numeric types to aggregate

Traceback (most recent call last):
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/superset/viz.py", line 277, in get_payload
    data = self.get_data(df)
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/superset/viz.py", line 1035, in get_data
    df = self.process_data(df)
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/superset/viz.py", line 971, in process_data
    values=fd.get('metrics'))
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/pandas/core/reshape/pivot.py", line 136, in pivot_table
    agged = grouped.agg(aggfunc)
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/pandas/core/groupby.py", line 4036, in aggregate
    return super(DataFrameGroupBy, self).aggregate(arg, *args, **kwargs)
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/pandas/core/groupby.py", line 3468, in aggregate
    result, how = self._aggregate(arg, _level=_level, *args, **kwargs)
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/pandas/core/base.py", line 435, in _aggregate
    **kwargs), None
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/pandas/core/base.py", line 391, in _try_aggregate_string_function
    return f(*args, **kwargs)
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/pandas/core/groupby.py", line 1037, in mean
    return self._cython_agg_general('mean', **kwargs)
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/pandas/core/groupby.py", line 3354, in _cython_agg_general
    how, alt=alt, numeric_only=numeric_only)
  File "/srv/venvs/service/trusty/service_venv_python3.6/lib/python3.6/site-packages/pandas/core/groupby.py", line 3425, in _cython_agg_blocks
    raise DataError('No numeric types to aggregate')
pandas.core.base.DataError: No numeric types to aggregate

mistercrunch avatar Nov 22 '17 00:11 mistercrunch

When you filed this issue, do you know/remember if pandas was reading your raw data in as VARCHAR? I ran into this issue again, though I worked around it by casting my desired metric to INTEGER/DOUBLE.

jeffreythewang avatar Jul 19 '18 18:07 jeffreythewang

Pretty sure this has been tackled by now. Closing. Let's reopen with more details if this message comes back up.

mistercrunch avatar Jul 20 '18 23:07 mistercrunch