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()))); } }
@Override public void cleanUpInputFileChangedOp() throws HiveException { inputFileChanged = true; // 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()))); } }
@Override public void cleanUpInputFileChangedOp() throws HiveException { inputFileChanged = true; // 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()))); } }