sascha-coenen edited a comment 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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to