-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design of MaterializedViewQuery #6977
Comments
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.
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:
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/dsql because no json wrapper is needed anymore, just a new type of an existing syntactical building block |
@sascha-coenen sounds interesting, would you like to make this a proposal? |
@sascha-coenen sounds good to me too. |
@sascha-coenen Thanks for your suggestion, "view datasource" is more appropriate. |
This issue has been marked as stale due to 280 days of inactivity. |
Currently, #5556 implements it as
MaterializedViewQuery
andMaterializedViewQueryQueryToolChest
, i. e. in the same type framework asQuery
andQueryToolChest
. However,MaterializedViewQuery
andMaterializedViewQueryQueryToolChest
are shallow and pass-through classes.MaterializedViewQueryQueryToolChest
couldn't sensibly return something fromgetResultTypeReference()
, so I wonder why it didn't throw NPE inDirectDruidClient
before, but I hit this problem in my change #6898.There should probably be an abstraction like "query modifier" and other parts of the infrastructure should recognize it.
cc @zhangxinyu1 @jihoonson
The text was updated successfully, but these errors were encountered: