@Override public Operator<? extends OperatorDesc> clone() throws CloneNotSupportedException { TableScanOperator ts = (TableScanOperator) super.clone(); ts.setNeededColumnIDs(new ArrayList<Integer>(getNeededColumnIDs())); ts.setNeededColumns(new ArrayList<String>(getNeededColumns())); ts.setReferencedColumns(new ArrayList<String>(getReferencedColumns())); return ts; }
@Override public Operator<? extends OperatorDesc> clone() throws CloneNotSupportedException { TableScanOperator ts = (TableScanOperator) super.clone(); ts.setNeededColumnIDs(new ArrayList<Integer>(getNeededColumnIDs())); ts.setNeededColumns(new ArrayList<String>(getNeededColumns())); ts.setReferencedColumns(new ArrayList<String>(getReferencedColumns())); return ts; }
/** * Collect table, partition and column level statistics * @param conf * - hive configuration * @param partList * - partition list * @param table * - table * @param tableScanOperator * - table scan operator * @return statistics object * @throws HiveException */ public static Statistics collectStatistics(HiveConf conf, PrunedPartitionList partList, ColumnStatsList colStatsCache, Table table, TableScanOperator tableScanOperator) throws HiveException { // column level statistics are required only for the columns that are needed List<ColumnInfo> schema = tableScanOperator.getSchema().getSignature(); List<String> neededColumns = tableScanOperator.getNeededColumns(); List<String> referencedColumns = tableScanOperator.getReferencedColumns(); return collectStatistics(conf, partList, table, schema, neededColumns, colStatsCache, referencedColumns); }
/** * Collect table, partition and column level statistics * @param conf * - hive configuration * @param partList * - partition list * @param table * - table * @param tableScanOperator * - table scan operator * @return statistics object * @throws HiveException */ public static Statistics collectStatistics(HiveConf conf, PrunedPartitionList partList, Table table, TableScanOperator tableScanOperator) throws HiveException { // column level statistics are required only for the columns that are needed List<ColumnInfo> schema = tableScanOperator.getSchema().getSignature(); List<String> neededColumns = tableScanOperator.getNeededColumns(); List<String> referencedColumns = tableScanOperator.getReferencedColumns(); return collectStatistics(conf, partList, table, schema, neededColumns, referencedColumns); }
public ColumnAccessInfo analyzeColumnAccess(ColumnAccessInfo columnAccessInfo) throws SemanticException { if (columnAccessInfo == null) { columnAccessInfo = new ColumnAccessInfo(); } Collection<TableScanOperator> topOps = pGraphContext.getTopOps().values(); for (TableScanOperator top : topOps) { // if a table is inside view, we do not care about its authorization. if (!top.isInsideView()) { Table table = top.getConf().getTableMetadata(); String tableName = table.getCompleteName(); List<String> referenced = top.getReferencedColumns(); for (String column : referenced) { columnAccessInfo.add(tableName, column); } if (table.isPartitioned()) { PrunedPartitionList parts = pGraphContext.getPrunedPartitions(table.getTableName(), top); if (parts.getReferredPartCols() != null) { for (String partKey : parts.getReferredPartCols()) { columnAccessInfo.add(tableName, partKey); } } } } } return columnAccessInfo; } }
public ColumnAccessInfo analyzeColumnAccess(ColumnAccessInfo columnAccessInfo) throws SemanticException { if (columnAccessInfo == null) { columnAccessInfo = new ColumnAccessInfo(); } Collection<TableScanOperator> topOps = pGraphContext.getTopOps().values(); for (TableScanOperator top : topOps) { // if a table is inside view, we do not care about its authorization. if (!top.isInsideView()) { Table table = top.getConf().getTableMetadata(); String tableName = table.getCompleteName(); List<String> referenced = top.getReferencedColumns(); for (String column : referenced) { columnAccessInfo.add(tableName, column); } if (table.isPartitioned()) { PrunedPartitionList parts = pGraphContext.getPrunedPartitions(table.getTableName(), top); if (parts.getReferredPartCols() != null) { for (String partKey : parts.getReferredPartCols()) { columnAccessInfo.add(tableName, partKey); } } } } } return columnAccessInfo; } }
@Override public Operator<? extends OperatorDesc> clone() throws CloneNotSupportedException { TableScanOperator ts = (TableScanOperator) super.clone(); ts.setNeededColumnIDs(new ArrayList<Integer>(getNeededColumnIDs())); ts.setNeededColumns(new ArrayList<String>(getNeededColumns())); ts.setReferencedColumns(new ArrayList<String>(getReferencedColumns())); return ts; }
/** * Collect table, partition and column level statistics * @param conf * - hive configuration * @param partList * - partition list * @param table * - table * @param tableScanOperator * - table scan operator * @return statistics object * @throws HiveException */ public static Statistics collectStatistics(HiveConf conf, PrunedPartitionList partList, Table table, TableScanOperator tableScanOperator) throws HiveException { // column level statistics are required only for the columns that are needed List<ColumnInfo> schema = tableScanOperator.getSchema().getSignature(); List<String> neededColumns = tableScanOperator.getNeededColumns(); List<String> referencedColumns = tableScanOperator.getReferencedColumns(); return collectStatistics(conf, partList, table, schema, neededColumns, referencedColumns); }
public ColumnAccessInfo analyzeColumnAccess() throws SemanticException { ColumnAccessInfo columnAccessInfo = new ColumnAccessInfo(); Collection<Operator<? extends OperatorDesc>> topOps = pGraphContext.getTopOps().values(); for (Operator<? extends OperatorDesc> op : topOps) { if (op instanceof TableScanOperator) { TableScanOperator top = (TableScanOperator) op; Table table = top.getConf().getTableMetadata(); String tableName = table.getCompleteName(); List<String> referenced = top.getReferencedColumns(); for (String column : referenced) { columnAccessInfo.add(tableName, column); } if (table.isPartitioned()) { PrunedPartitionList parts = pGraphContext.getPrunedPartitions(table.getTableName(), top); if (parts.getReferredPartCols() != null) { for (String partKey : parts.getReferredPartCols()) { columnAccessInfo.add(tableName, partKey); } } } } } return columnAccessInfo; } }