sb.append(orig_spacer).append(NODE_PREFIX + node.toString() + "\n");
sb.append(inner_spacer).append("Inline[" + node.isInline() + "]\n");
// AbstractJoinPlanNode
if (node instanceof AbstractJoinPlanNode) {
AbstractJoinPlanNode cast_node = (AbstractJoinPlanNode) node;
sb.append(inner_spacer).append("JoinType[" + cast_node.getJoinType() + "]\n");
sb.append(inner_spacer).append("Join Expression: " + (cast_node.getPredicate() != null ? "\n" + ExpressionUtil.debug(cast_node.getPredicate(), line_spacer) : null + "\n"));
// AbstractOperationPlanNode
} else if (node instanceof AbstractOperationPlanNode) {
sb.append(inner_spacer).append("TargetTableId[" + ((AbstractOperationPlanNode) node).getTargetTableName() + "]\n");
// AbstractScanPlanNode
} else if (node instanceof AbstractScanPlanNode) {
AbstractScanPlanNode cast_node = (AbstractScanPlanNode) node;
sb.append(inner_spacer).append("TargetTableName[" + cast_node.getTargetTableName() + "]\n");
sb.append(inner_spacer).append("TargetTableAlias[" + cast_node.getTargetTableAlias() + "]\n");
sb.append(inner_spacer).append("TargetTableId[" + cast_node.getTargetTableName() + "]\n");
}
// AggregatePlanNode
if (node instanceof AggregatePlanNode) {
AggregatePlanNode cast_node = (AggregatePlanNode) node;
sb.append(inner_spacer).append("AggregateTypes[" + cast_node.getAggregateTypes().size() + "]: " + cast_node.getAggregateTypes() + "\n");
sb.append(inner_spacer).append("AggregateColumnOffsets[" + cast_node.getAggregateOutputColumns().size() + "]: " + cast_node.getAggregateOutputColumns() + "\n");
sb.append(inner_spacer).append(PlanNodeUtil.debugOutputColumns("AggregateColumns", cast_node.getAggregateColumnGuids(), line_spacer));
sb.append(inner_spacer).append(PlanNodeUtil.debugOutputColumns("GroupByColumns", cast_node.getGroupByColumnGuids(), line_spacer));
// DeletePlanNode
} else if (node instanceof DeletePlanNode) {
sb.append(inner_spacer).append("Truncate[" + ((DeletePlanNode) node).isTruncate() + "\n");
// DistinctPlanNode
} else if (node instanceof DistinctPlanNode) {
DistinctPlanNode dist_node = (DistinctPlanNode) node;
PlanColumn col = PlannerContext.singleton().get(dist_node.getDistinctColumnGuid());
sb.append(inner_spacer).append("DistinctColumn[" + col + "]\n");
// IndexScanPlanNode
} else if (node instanceof IndexScanPlanNode) {
IndexScanPlanNode cast_node = (IndexScanPlanNode) node;
sb.append(inner_spacer).append("TargetIndexName[" + cast_node.getTargetIndexName() + "]\n");
sb.append(inner_spacer).append("EnableKeyIteration[" + cast_node.getKeyIterate() + "]\n");
sb.append(inner_spacer).append("IndexLookupType[" + cast_node.getLookupType() + "]\n");
sb.append(inner_spacer).append("SearchKey Expressions:\n");
for (AbstractExpression search_key : cast_node.getSearchKeyExpressions()) {
sb.append(ExpressionUtil.debug(search_key, line_spacer));
}
sb.append(inner_spacer).append("End Expression: " + (cast_node.getEndExpression() != null ? "\n" + ExpressionUtil.debug(cast_node.getEndExpression(), line_spacer) : null + "\n"));
sb.append(inner_spacer).append("Post-Scan Expression: " + (cast_node.getPredicate() != null ? "\n" + ExpressionUtil.debug(cast_node.getPredicate(), line_spacer) : null + "\n"));
// InsertPlanNode
} else if (node instanceof InsertPlanNode) {
sb.append(inner_spacer).append("MultiPartition[" + ((InsertPlanNode) node).getMultiPartition() + "]\n");
// LimitPlanNode
} else if (node instanceof LimitPlanNode) {
sb.append(inner_spacer).append("Limit[" + ((LimitPlanNode) node).getLimit() + "]\n");
sb.append(inner_spacer).append("Offset[" + ((LimitPlanNode) node).getOffset() + "]\n");
// NestLoopIndexPlanNode
} else if (node instanceof NestLoopIndexPlanNode) {
// Nothing
// NestLoopPlanNode
} else if (node instanceof NestLoopPlanNode) {
// Nothing
} else if (node instanceof OrderByPlanNode) {
OrderByPlanNode cast_node = (OrderByPlanNode) node;
sb.append(inner_spacer).append(PlanNodeUtil.debugOutputColumns("SortColumns", cast_node.getSortColumnGuids(), line_spacer));
} else if (node instanceof ProjectionPlanNode) {
// ProjectionPlanNode cast_node = (ProjectionPlanNode)node;
if (node instanceof MaterializePlanNode) {
sb.append(line_spacer).append("Batched[" + ((MaterializePlanNode) node).isBatched() + "]\n");