List<HCatFieldSchema> partKeys) {
StringBuilder sb = new StringBuilder();
sb.append("create table ").append(dbName.toLowerCase()).append('.');
sb.append(tableName.toLowerCase()).append(" (\n\t");
for (int i = 0; i < tableCols.size(); ++i) {
HCatFieldSchema hfs = tableCols.get(i);
if (i > 0) {
sb.append(",\n\t");
}
sb.append(hfs.getName().toLowerCase());
sb.append(' ').append(hfs.getTypeString());
}
sb.append(")\n");
if (partKeys != null && partKeys.size() > 0) {
sb.append("partitioned by (\n\t");
for (int i = 0; i < partKeys.size(); ++i) {
HCatFieldSchema hfs = partKeys.get(i);
if (i > 0) {
sb.append("\n\t,");
}
sb.append(hfs.getName().toLowerCase());
sb.append(' ').append(hfs.getTypeString());
}
sb.append(")\n");
}
sb.append(getStorageInfo());
LOG.info("Create table command : " + sb);