public String toString() { StringBuilder sb = new StringBuilder("Partitions Scan (table=").append(getTableName()); if (hasAlias()) { sb.append(", alias=").append(alias); } if (hasQual()) { sb.append(", filter=").append(qual); } sb.append(", uri=").append(getTableDesc().getUri()).append(")"); return sb.toString(); }
private void updateTableStat(OverridableConf queryContext, PartitionedTableScanNode scanNode) throws TajoException { if (scanNode.getInputPaths().length > 0) { try { FileSystem fs = scanNode.getInputPaths()[0].getFileSystem(queryContext.getConf()); long totalVolume = 0; for (Path input : scanNode.getInputPaths()) { ContentSummary summary = fs.getContentSummary(input); totalVolume += summary.getLength(); } scanNode.getTableDesc().getStats().setNumBytes(totalVolume); } catch (Throwable e) { throw new TajoInternalError(e); } } }
@Override public Object visitScan(OverridableConf queryContext, LogicalPlan plan, LogicalPlan.QueryBlock block, ScanNode scanNode, Stack<LogicalNode> stack) throws TajoException { TableDesc table = scanNode.getTableDesc(); if (!table.hasPartition()) { return null; } try { Path [] filteredPaths = findFilteredPartitionPaths(queryContext, scanNode); plan.addHistory("PartitionTableRewriter chooses " + filteredPaths.length + " of partitions"); PartitionedTableScanNode rewrittenScanNode = plan.createNode(PartitionedTableScanNode.class); rewrittenScanNode.init(scanNode, filteredPaths); rewrittenScanNode.getTableDesc().getStats().setNumBytes(totalVolume); // if it is topmost node, set it as the rootnode of this block. if (stack.empty() || block.getRoot().equals(scanNode)) { block.setRoot(rewrittenScanNode); } else { PlannerUtil.replaceNode(plan, stack.peek(), scanNode, rewrittenScanNode); } block.registerNode(rewrittenScanNode); } catch (IOException e) { throw new TajoInternalError("Partitioned Table Rewrite Failed: \n" + e.getMessage()); } return null; } }
if (pScanNode.getTableDesc().getStats() == null) { return 0; } else { return pScanNode.getTableDesc().getStats().getNumBytes();
if (pScanNode.getTableDesc().getStats() == null) { return 0; } else { return pScanNode.getTableDesc().getStats().getNumBytes();
if (pScanNode.getTableDesc().getStats() == null) { return 0; } else { return pScanNode.getTableDesc().getStats().getNumBytes();
if (pScanNode.getTableDesc().getStats() == null) { return 0; } else { return pScanNode.getTableDesc().getStats().getNumBytes();