/** * Clear input paths of {@link PartitionedTableScanNode}. * This is to avoid unnecessary transmission of a lot of partition table paths to workers. * So, this method should be invoked before {@link org.apache.tajo.querymaster.Stage#scheduleFragment(Stage, Fragment)} * unless the scan is broadcasted. * * @param scanNode scan node */ public static void preparePartitionScanPlanForSchedule(ScanNode scanNode) { if (scanNode.getType() == NodeType.PARTITIONS_SCAN) { // TODO: The partition input paths don't have to be kept in a logical node at all. // This should be improved by implementing a specialized fragment for partition tables. PartitionedTableScanNode partitionScan = (PartitionedTableScanNode) scanNode; partitionScan.clearInputPaths(); } } }
public String toString() { StringBuilder sb = new StringBuilder(capitalize(getType().name()) + " (table=").append(getTableName()); if (hasAlias()) { sb.append(", alias=").append(alias); } if (hasQual()) { sb.append(", filter=").append(qual); } sb.append(", path=").append(getTableDesc().getUri()).append(")"); return sb.toString(); }
if (eachScan.getType() != NodeType.PARTITIONS_SCAN) { TableDesc tableDesc = masterContext.getTableDesc(eachScan);
Tablespace space = TablespaceManager.get(tableDesc.getUri()); if (eachScan.getType() == NodeType.PARTITIONS_SCAN) {
if (scan.getType() != NodeType.PARTITIONS_SCAN) { broadcastFragments.addAll(scanFragments);
if (scan.getType() == NodeType.PARTITIONS_SCAN) { PartitionedTableScanNode partitionScan = (PartitionedTableScanNode) scan; partitionScanPaths = partitionScan.getInputPaths(); baseFragments = scanFragments; } else { if (scan.getType() == NodeType.PARTITIONS_SCAN) { PartitionedTableScanNode partitionScan = (PartitionedTableScanNode)scan;
/** * Get a volume of a table of a partitioned table * @param scanNode ScanNode corresponding to a table * @return table volume (bytes) */ public static long getTableVolume(ScanNode scanNode) { if (scanNode.getTableDesc().hasStats()) { long scanBytes = scanNode.getTableDesc().getStats().getNumBytes(); if (scanNode.getType() == NodeType.PARTITIONS_SCAN) { PartitionedTableScanNode pScanNode = (PartitionedTableScanNode) scanNode; if (pScanNode.getInputPaths() == null || pScanNode.getInputPaths().length == 0) { scanBytes = 0L; } } return scanBytes; } else { return -1; } }
/** * Get a volume of a table of a partitioned table * @param scanNode ScanNode corresponding to a table * @return table volume (bytes) */ private static long getTableVolume(ScanNode scanNode) { if (scanNode.getTableDesc().hasStats()) { long scanBytes = scanNode.getTableDesc().getStats().getNumBytes(); if (scanNode.getType() == NodeType.PARTITIONS_SCAN) { PartitionedTableScanNode pScanNode = (PartitionedTableScanNode) scanNode; if (pScanNode.getInputPaths() == null || pScanNode.getInputPaths().length == 0) { scanBytes = 0L; } } return scanBytes; } else { return -1; } } }
/** * Get a volume of a table of a partitioned table * @param scanNode ScanNode corresponding to a table * @return table volume (bytes) */ public static long getTableVolume(ScanNode scanNode) { if (scanNode.getTableDesc().hasStats()) { long scanBytes = scanNode.getTableDesc().getStats().getNumBytes(); if (scanNode.getType() == NodeType.PARTITIONS_SCAN) { PartitionedTableScanNode pScanNode = (PartitionedTableScanNode) scanNode; if (pScanNode.getInputPaths() == null || pScanNode.getInputPaths().length == 0) { scanBytes = 0L; } } return scanBytes; } else { return TajoConstants.UNKNOWN_LENGTH; } } }
if (scan.getType() == NodeType.PARTITIONS_SCAN) {