private static long getDataSize(Path location, Configuration conf) throws IOException {
    FileSystem fs = location.getFileSystem(conf);
    ContentSummary cs = fs.getContentSummary(location);
    return cs.getLength();
  }
@param location - path to a partition (or table if not partitioned) dir
ql/src/java/org/apache/hadoop/hive/ql/util/UpgradeTool.java