static void createEmptyBuckets(Configuration hconf, List<Path> paths,
      boolean isCompressed, TableDesc tableInfo, Reporter reporter)
      throws HiveException, IOException {

    JobConf jc;
    if (hconf instanceof JobConf) {
      jc = new JobConf(hconf);
    } else {
      // test code path
      jc = new JobConf(hconf);
    }
    HiveOutputFormat<?, ?> hiveOutputFormat = null;
    Class<? extends Writable> outputClass = null;
    try {
      AbstractSerDe serde = tableInfo.getSerDeClass().newInstance();
      serde.initialize(hconf, tableInfo.getProperties(), null);
      outputClass = serde.getSerializedClass();
      hiveOutputFormat = HiveFileFormatUtils.getHiveOutputFormat(hconf, tableInfo);
    } catch (SerDeException e) {
      throw new HiveException(e);
    } catch (InstantiationException e) {
      throw new HiveException(e);
    } catch (IllegalAccessException e) {
      throw new HiveException(e);
    }

    for (Path path : paths) {
      Utilities.FILE_OP_LOGGER.trace("creating empty bucket for {}", path);
      RecordWriter writer = hiveOutputFormat.getHiveRecordWriter(jc, path, outputClass, isCompressed,
          tableInfo.getProperties(), reporter);
      writer.close(false);
      LOG.info("created empty bucket for enforcing bucketing at {}", path);
    }
  }
Check the existence of buckets according to bucket specification. Create empty buckets if
needed.

@param hconf The definition of the FileSink.
@param paths A list of empty buckets to create
@param reporter The mapreduce reporter object
@throws HiveException
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java