@Test public void testFailure() throws Exception { String query = null; try { query = "A.b"; getTranslator(deployContext).translate(deployParser.parse(query)); Assert.assertFalse(true); } catch (Exception qte) { } try { query = "Manifest.ddd"; getTranslator(deployContext).translate(deployParser.parse(query)); Assert.assertFalse(true); } catch (Exception qte) { } }
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);  }