private void appendSortBy(List<String> keys) {
    if (keys.isEmpty()) {
      return;
    }
    queryStr.append(INDENT).append("SORT BY ");
    queryStr.append(StringUtils.join(keys, ","));
    queryStr.append("\n");
  }
Append list of partition columns to Insert statement. If user specified partition spec, then
use it to get/set the value for partition column else use dynamic partition mode with no value.
Static partition mode:
INSERT INTO T PARTITION(partCol1=val1,partCol2...) SELECT col1, ... partCol1,partCol2...
Dynamic partition mode:
INSERT INTO T PARTITION(partCol1,partCol2...) SELECT col1, ... partCol1,partCol2...
ql/src/java/org/apache/hadoop/hive/ql/parse/rewrite/sql/MultiInsertSqlGenerator.java