You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/02/10 16:50:28 UTC

[GitHub] sascha-coenen commented on issue #6977: Design of MaterializedViewQuery

sascha-coenen commented on issue #6977: Design of MaterializedViewQuery
URL: https://github.com/apache/incubator-druid/issues/6977#issuecomment-462150389
 
 
   I would propose to model materialized views as a new type of datasource instead of requiring a json wrapper around existing query types as is the current solution. 
   So instead of 
   
   ```
   { 
     "queryType": 
     "view", 
     "query": { 
       "queryType": "groupBy", 
       "dataSource": "wikiticker", 
       "granularity": "all"
       ...
     }
   }
   ```
   
   I would use the existing functionality of having different types of dataSource references to indicate that the query is to be executed on a view instead of a raw datasource like so:
   
   { 
       "type": "groupBy", 
       "dataSource": {
           "type": "view",
           "name": "wikiticker"
       }, 
       "granularity": "all"
       ...
   }
   ```
   
   Ref to druid documentation about different types of datasources: http://druid.io/docs/latest/querying/datasource.html
   
   Basically, with this approach, a materialized view would be structurally equivalent to a union query.
   
   When dataSource.type is set to "view", then the query would scan segments of the master table and any related cuboids and when setting the type to table, one could direct Druid to explicitly query only a particular materialized cuboid. 
   
   Another advantage would be that it would be more straightforward to add support for materialized views in client frameworks like plywood/pivot plyql because no json wrapper is needed anymore, just a new type of an existing syntax

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org