sreemanamala commented on code in PR #17406:
URL: https://github.com/apache/druid/pull/17406#discussion_r1827218142
##########
sql/src/test/java/org/apache/druid/quidem/DruidQuidemCommandHandler.java:
##########
@@ -245,6 +269,159 @@ static class DruidPlanCommand extends
AbstractRelPlanCommand
}
}
+ static class HintPlanCommand extends AbstractRelPlanCommand
+ {
+ HintPlanCommand(List<String> lines, List<String> content)
+ {
+ super(lines, content, DruidHook.DRUID_PLAN);
+ }
+
+ @Override
+ protected String getString(RelNode node)
+ {
+ final List<String> hintsCollect = new ArrayList<>();
+ final HintCollector collector = new HintCollector(hintsCollect);
+ node.accept(collector);
+ StringBuilder builder = new StringBuilder();
+ for (String hintLine : hintsCollect) {
+ builder.append(hintLine).append("\n");
+ }
+
+ return builder.toString();
+ }
+
+ private static class HintCollector extends RelShuttleImpl
+ {
+ private final List<String> hintsCollect;
+
+ HintCollector(List<String> hintsCollect)
+ {
+ this.hintsCollect = hintsCollect;
+ }
+
+ @Override
+ public RelNode visit(TableScan scan)
+ {
+ if (!scan.getHints().isEmpty()) {
+ this.hintsCollect.add("TableScan:" + scan.getHints());
+ }
Review Comment:
This would not give the abstracted class names, Initially I copied this
calcite. But i guess for our case we doent need to have all those
implementations. removed and modified as mentioned in the other comments
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]