-
Notifications
You must be signed in to change notification settings - Fork 66
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
UNION ALL not supported #320
Comments
@Beastjoe Could you take a look at this issue (add relevant test cases too)? I think this should be a simple logical issue. |
@pyongjoo Previously, I think we haven't considered the case of set operation inside user query. You can check visitQuery_expression() method in RelationGen class. It may be a bit complex to fix this. One solution is to treat the SetOperationRelation as a SelectQuery, but I am not sure what to do when scramble tables are involved. Do you have any suggestions? Thanks. |
SetOperationRelation must not be SelectQuery simply because it is not. SetOperationRelation should just be a subclass of AbstractRelation. Doesn't the antlr grammar already cover the case that a relation can include UNION? Otherwise, we can simply extend it. |
Yes, the grammer has already covered the case. QueryNode only handles SelectQuery, I think some similar classes need to be created to handle the set operation inside user query. Besides, I am not sure what should we do when both relations in set operation involves scramble tables, such as
or
|
Hmm. I thought the query is like select count(distinct col) from which was the reason I said the union must not be treated as a select query. Let me double-check the OP’s another query example and let you know. In this case, however, I agree that the union query should also be a select query. |
@commercial-hippie I just noticed that the example query you posted here is different from the one I saw before. The one I saw before was:
Can you confirm which one we should focus on? The query you posted here is nothing but two select queries. |
@pyongjoo I think the query you posted is probably the way to go.. |
@Beastjoe Can you quickly test if the query as follows runs without errors?
|
No. VerdictDB currently neglects the right side of the union all operation and only takes the leftmost query. I will start to fix this. |
Thanks! |
@Beastjoe Can you comment on the current status? No rush, but just wondering. Thanks. |
I have finished standardizing query containing the set operations. The next step is to add support of creating AsyncAggExecutionPlan for set operations. For instance, if a query is
my implementation will change the query to
If the set operation contain some scramble tables, we can then add the constraint in the inner query. |
Instead of adding an extra depth for the inner query, could we simply make UNION as an instance of SelectQuery? |
I think it is feasible.
If table1 and table2 are scramble tables, and we wish to add the filter later, such as verdictdbblock, is it correct to add them directly in the set operation queries? |
I think SetOperationQuery can be an instance of SelectQuery. I was wrong previously. |
@Beastjoe I believe these are the todos we discussed. Please pursue these items as separate pull requests.
|
I saw that there was a previous task created for this but I think that Verdict has been reworked a lot and support for unions was probably lost somewhere along the way.
Here are some tests I ran.. Excuse the formatting it's from a proxy that returns JSON.
I currently have a workaround implemented for our use case but this would be awesome to have in the core. 😄
The text was updated successfully, but these errors were encountered: