@Test public void testSetQueryPlanUnion() { String query = "ApplicationService.(services[@name=~\"srp-app.*\"] || updateStrategies{*})"; QueryExecPlan plan = getTranslator(raptorContext).translate(raptorParser.parse(query)); }
public QueryExecPlan translate(ParseBaseNode rootNode) { QueryExecPlan execPlan = new QueryExecPlan(); rewriteParseTree(rootNode, null); rewriteProjection(rootNode); nodeIndex = 0; rootAction = translateParseTree(rootNode, execPlan); checkTooManyCollectionsQuery(execPlan); rewriteRootAction(execPlan); if (hasEmbed) { constructEmbedContainer(); } execPlan.setRootAction(rootAction); execPlan.setRootNode(rootNode); if (execPlan.getAggAction() != null) { if (rootAction.getChildrenActions().isEmpty()) { AggregateAction aggAction = (AggregateAction)execPlan.getAggAction(); aggAction.setOneTableAggregation(true); } if (queryContext.isCountOnly()) { throw new QueryParseException(QueryErrCodeEnum.AGG_COUNT_NOT_SUPPORT, "Aggregation query does not support count mode!"); } } return execPlan; }
QueryTranslator { public QueryExecPlan translate(ParseBaseNode rootNode) { QueryExecPlan execPlan = new QueryExecPlan(); rewriteParseTree(rootNode, null); rewriteProjection(rootNode); nodeIndex = 0; rootAction = translateParseTree(rootNode, execPlan); checkTooManyCollectionsQuery(execPlan); rewriteRootAction(execPlan); if (hasEmbed) { constructEmbedContainer(); } execPlan.setRootAction(rootAction); execPlan.setRootNode(rootNode); if (execPlan.getAggAction() != null) { if (rootAction.getChildrenActions().isEmpty()) { AggregateAction aggAction = (AggregateAction)execPlan.getAggAction(); aggAction.setOneTableAggregation(true); } if (queryContext.isCountOnly()) { throw new QueryParseException(QueryErrCodeEnum.AGG_COUNT_NOT_SUPPORT, "Aggregation query does not support count mode!"); } } return execPlan; } }
QueryTranslator { public QueryExecPlan translate(ParseBaseNode rootNode) { QueryExecPlan execPlan = new QueryExecPlan(); rewriteParseTree(rootNode, null); rewriteProjection(rootNode); nodeIndex = 0; rootAction = translateParseTree(rootNode, execPlan); checkTooManyCollectionsQuery(execPlan); rewriteRootAction(execPlan); if (hasEmbed) { constructEmbedContainer(); } execPlan.setRootAction(rootAction); execPlan.setRootNode(rootNode); if (execPlan.getAggAction() != null) { if (rootAction.getChildrenActions().isEmpty()) { AggregateAction aggAction = (AggregateAction)execPlan.getAggAction(); aggAction.setOneTableAggregation(true); } if (queryContext.isCountOnly()) { throw new QueryParseException(QueryErrCodeEnum.AGG_COUNT_NOT_SUPPORT, "Aggregation query does not support count mode!"); } } return execPlan; } QueryTranslator(QueryContext context); }
QueryTranslator { public QueryExecPlan translate(ParseBaseNode rootNode) { QueryExecPlan execPlan = new QueryExecPlan(); rewriteParseTree(rootNode, null); rewriteProjection(rootNode); nodeIndex = 0; rootAction = translateParseTree(rootNode, execPlan); checkTooManyCollectionsQuery(execPlan); rewriteRootAction(execPlan); if (hasEmbed) { constructEmbedContainer(); } execPlan.setRootAction(rootAction); execPlan.setRootNode(rootNode); if (execPlan.getAggAction() != null) { if (rootAction.getChildrenActions().isEmpty()) { AggregateAction aggAction = (AggregateAction)execPlan.getAggAction(); aggAction.setOneTableAggregation(true); } if (queryContext.isCountOnly()) { throw new QueryParseException(QueryErrCodeEnum.AGG_COUNT_NOT_SUPPORT, "Aggregation query does not support count mode!"); } } return execPlan; } QueryTranslator(QueryContext context); QueryExecPlan translate(ParseBaseNode rootNode); }
QueryTranslator { public QueryExecPlan translate(ParseBaseNode rootNode) { QueryExecPlan execPlan = new QueryExecPlan(); rewriteParseTree(rootNode, null); rewriteProjection(rootNode); nodeIndex = 0; rootAction = translateParseTree(rootNode, execPlan); checkTooManyCollectionsQuery(execPlan); rewriteRootAction(execPlan); if (hasEmbed) { constructEmbedContainer(); } execPlan.setRootAction(rootAction); execPlan.setRootNode(rootNode); if (execPlan.getAggAction() != null) { if (rootAction.getChildrenActions().isEmpty()) { AggregateAction aggAction = (AggregateAction)execPlan.getAggAction(); aggAction.setOneTableAggregation(true); } if (queryContext.isCountOnly()) { throw new QueryParseException(QueryErrCodeEnum.AGG_COUNT_NOT_SUPPORT, "Aggregation query does not support count mode!"); } } return execPlan; } QueryTranslator(QueryContext context); QueryExecPlan translate(ParseBaseNode rootNode);  }