public OptionalInt getBucketId() {
      if (inputSplit instanceof PartitionAwareSplit) {
        return ((PartitionAwareSplit) inputSplit).getBucketId();
      }

      final int bucketId = Utilities.parseSplitBucket(inputSplit);
      return bucketId == -1 ? OptionalInt.empty() : OptionalInt.of(bucketId);
    }
HiveInputSplit encapsulates an InputSplit with its corresponding
inputFormatClass. The reason that it derives from FileSplit is to make sure
"map.input.file" in MapTask.
ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java