Skip to content
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

DrillWindowQueryTest: use proper way to decide if the query is ordered #15118

Merged
merged 185 commits into from
Oct 23, 2023

Conversation

kgyrtkirk
Copy link
Member

@LakshSingla LakshSingla removed this from the 28.0 milestone Oct 16, 2023
@kgyrtkirk kgyrtkirk marked this pull request as ready for review October 18, 2023 20:40
@abhishekagarwal87 abhishekagarwal87 added this to the 28.0 milestone Oct 19, 2023

public QueryResults(
final Map<String, Object> queryContext,
final String vectorizeOption,
final RelDataType sqlSignature,
final List<Object[]> results,
final List<Query<?>> recordedQueries,
final PlannerCaptureHook capture
final PlannerHook capture
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to use PlannerHook instead of PlannerCaptureHook here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to have the interface instead ; so that later other implementations can be used

...however it can be interpreted like the system captures a set of things for you and here they are in the QueryResults

I would rather see the results of this hook like a map of values or something instead of the hook itself...
I find this whole thing oddly designed as the interface has only captureX methods ; meanwhile the PlannerCaptureHook has the getX-s

should I change it back?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree that the interface is a bit odd in terms of using it practically. But given that we specifically know how we want to use it in the tests, I think we can use PlannerCaptureHook itself - since that provides the interface + extra capabilities/bridge methods that we need.

Copy link
Member

@rohangarg rohangarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the changes @kgyrtkirk

sql = sql.toLowerCase(Locale.ENGLISH).replace('\n', ' ');
sql = sql.substring(sql.lastIndexOf(')'));
return sql.contains("order");
SqlNode sqlNode = ((PlannerCaptureHook) queryResults.capture).getSqlNode();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SqlNode sqlNode = ((PlannerCaptureHook) queryResults.capture).getSqlNode();
SqlNode sqlNode = queryResults.capture.getSqlNode();

this can be done in any later change, no need to run CI for this!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure; I think my IDE will remove this cast right away when I next change that file

@rohangarg rohangarg merged commit 2e31cb2 into apache:master Oct 23, 2023
82 checks passed
@kgyrtkirk
Copy link
Member Author

Thank you @rohangarg for reviewing and merging the changes!

@LakshSingla
Copy link
Contributor

Removing the milestone since it is a test change and shouldn't affect the behavior, therefore backporting is not needed.

CaseyPan pushed a commit to CaseyPan/druid that referenced this pull request Nov 17, 2023
@LakshSingla LakshSingla added this to the 29.0.0 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants