HashSet<String> expectedQueries = new HashSet<String>();
// Compare atomic queries
for (int i = 0; i < expectedAtomic.length; i++) {
final String sql = expectedAtomic[i];
Command command;
try {
command = helpGetCommand(sql, md, null);
Collection groups = GroupCollectorVisitor.getGroupsIgnoreInlineViews(command, false);
final GroupSymbol symbol = (GroupSymbol)groups.iterator().next();
Object modelId = md.getModelID(symbol.getMetadataID());
boolean supportsGroupAliases = CapabilitiesUtil.supportsGroupAliases(modelId, md, capFinder);
boolean supportsProjection = CapabilitiesUtil.supports(Capability.QUERY_SELECT_EXPRESSION, modelId, md, capFinder);
command.acceptVisitor(new AliasGenerator(supportsGroupAliases, !supportsProjection));
expectedQueries.add(command.toString());
} catch (Exception err) {
throw new RuntimeException(err);
}
}