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 2022/01/22 01:44:08 UTC

[GitHub] [superset] pabrahamusa opened a new issue #18135: Set GROUP BY to empty for /chart/data POST request

pabrahamusa opened a new issue #18135:
URL: https://github.com/apache/superset/issues/18135


   I am  trying to query the Chart API at /chart/data POST request. The payload is as below and it is adding GROUP BY clause automatically to the underlying SQL which conflicts with the ORDER BY clause. This is causing my call to fail and I want to set the GROUP BY clause to empty and allow passing of ORDER BY. Is there a way to achieve this?
   
   `
   
   {
     "datasource": {
       "id": 1,
       "type": "table"
     },
     "force": false,
     "queries": [
       {
         "time_range": "2022-01-22T01:14:00 : 2022-01-22T01:29:19",
         "granularity": "timemillis",
         "filters": [
           {
             "col": "firstcolumn",
             "op": "==",
             "val": "dummyvalue"
           }
         ],
         "extras": {
           "time_grain_sqla": "P1D",
           "time_range_endpoints": [
             "inclusive",
             "exclusive"
           ],
           "having": "",
           "having_druid": [],
           "where": ""
         },
         "applied_time_extras": {},
         "columns": [
           "timemillis",
           "firstcolumn",
           "secondcolumn",
           "thirdcolumn"
         ],
         "groupby": [],
         "orderby": [
           [
             "timemillis",
             false
           ]
         ],
         "annotation_layers": [],
         "row_limit": 10000,
         "timeseries_limit": 0,
         "order_desc": false,
         "url_params": {},
         "custom_params": {},
         "custom_form_data": {},
         "post_processing": [],
         "metrics": []
       }
     ],
     "result_format": "json",
     "result_type": "full"
   }
   `
   
   However I can see the query is generated with a GROUP BY clause which causes the call to fail. The SQL query generated is
   
   `
   SELECT timemillis,
          firstcolumn,
          secondcolumn,
          thirdcolumn
   FROM mytable
   WHERE firstcolumn = 'dummyvalue'
   GROUP BY timemillis,
          firstcolumn,
          secondcolumn,
          thirdcolumn
   ORDER BY timemillis DESC
   `
   
   The error I am getting is 
   
   `
   Traceback (most recent call last):
     File "/app/superset/connectors/sqla/models.py", line 1451, in query
       df = self.database.get_df(sql, self.schema, mutator=assign_column_label)
     File "/app/superset/models/core.py", line 389, in get_df
       self.db_engine_spec.execute(cursor, sqls[-1])
     File "/app/superset/db_engine_specs/base.py", line 1072, in execute
       raise cls.get_dbapi_mapped_exception(ex)
     File "/app/superset/db_engine_specs/base.py", line 1070, in execute
       cursor.execute(query)
     File "/usr/local/lib/python3.7/site-packages/pinotdb/db.py", line 44, in g
       return f(self, *args, **kwargs)
     File "/usr/local/lib/python3.7/site-packages/pinotdb/db.py", line 303, in execute
       raise exceptions.DatabaseError(msg)
   pinotdb.exceptions.DatabaseError: {'errorCode': 700,
    'message': 'QueryValidationError:\n'
               'java.lang.UnsupportedOperationException: ORDER By should be only '
               'on some/all of the columns passed as arguments to DISTINCT\n'
               '\tat '
               'org.apache.pinot.broker.requesthandler.BaseBrokerRequestHandler.validateRequest(BaseBrokerRequestHandler.java:1249)\n'
   `
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [superset] srinify commented on issue #18135: Set GROUP BY to empty for /chart/data POST request

Posted by GitBox <gi...@apache.org>.
srinify commented on issue #18135:
URL: https://github.com/apache/superset/issues/18135#issuecomment-1023229876


   Hey there @pabrahamusa ! Do you mind posting in the #debug-together channel in the Superset Slack or over in Github Discussions? You can find a link to our Slack here: https://superset.apache.org/community
   
   We'd like to keep Github issues focused on bugs with reproduction instructions that can be validated, etc. Now if you're certain this IS a bug, definitely fill out the Github issue template for bugs :)


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [superset] srinify closed issue #18135: Set GROUP BY to empty for /chart/data POST request

Posted by GitBox <gi...@apache.org>.
srinify closed issue #18135:
URL: https://github.com/apache/superset/issues/18135


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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