private void updateFileId() {
    // If the file name to bucket number mapping is maintained, store the bucket number
    // in the execution context. This is needed for the following scenario:
    // insert overwrite table T1 select * from T2;
    // where T1 and T2 are sorted/bucketed by the same keys into the same number of buckets
    // Although one mapper per file is used (BucketizedInputHiveInput), it is possible that
    // any mapper can pick up any file (depending on the size of the files). The bucket number
    // corresponding to the input file is stored to name the output bucket file appropriately.
    Map<String, Integer> bucketNameMapping =
        (conf != null) ? conf.getBucketFileNameMapping() : null;
    if ((bucketNameMapping != null) && (!bucketNameMapping.isEmpty())) {
      Path currentInputPath = getExecContext().getCurrentInputPath();
      getExecContext().setFileId(Integer.toString(bucketNameMapping.get(
          currentInputPath.getName())));
    }
  }
Other than gathering statistics for the ANALYZE command, the table scan operator
does not do anything special other than just forwarding the row. Since the table
data is always read as part of the map-reduce framework by the mapper. But, when this
assumption stops to be true, i.e table data won't be only read by the mapper, this
operator will be enhanced to read the table.
ql/src/java/org/apache/hadoop/hive/ql/exec/TableScanOperator.java