public void validate(HiveConf conf) throws SemanticException {

    if (CollectionUtils.isEmpty(getCols())) {
      // if the table has no columns and is a HMS backed SerDe - it should have a storage handler OR
      // is a CREATE TABLE LIKE FILE statement.
      if (Table.hasMetastoreBasedSchema(conf, getSerde()) && StringUtils.isEmpty(getStorageHandler())
          && this.getLikeFile() == null) {
        throw new SemanticException(ErrorMsg.INVALID_TBL_DDL_SERDE.getMsg());
      }
      return;
    }

    if (this.getStorageHandler() == null) {
      try {
        Class<?> origin = Class.forName(this.getOutputFormat(), true, Utilities.getSessionSpecifiedClassLoader());
        Class<? extends OutputFormat> replaced = HiveFileFormatUtils.getOutputFormatSubstitute(origin);
        if (!HiveOutputFormat.class.isAssignableFrom(replaced)) {
          throw new SemanticException(ErrorMsg.INVALID_OUTPUT_FORMAT_TYPE.getMsg());
        }
      } catch (ClassNotFoundException e) {
        throw new SemanticException(ErrorMsg.CLASSPATH_ERROR.getMsg(), e);
      }
    }

    List<String> colNames = ParseUtils.validateColumnNameUniqueness(this.getCols());

    assertColumnsMatchSchema(colNames, this.getBucketCols());
    assertColumnsMatchSchema(colNames, Iterables.transform(this.getSortCols(), Order::getCol));

    if (this.getPartCols() != null) {
      // there is no overlap between columns and partitioning columns
      for (FieldSchema fs : this.getPartCols()) {
        String partCol = fs.getName();
        TypeInfo pti = null;
        try {
          pti = TypeInfoFactory.getPrimitiveTypeInfo(fs.getType());
        } catch (Exception err) {
          LOG.error("Failed to get type info", err);
        }
        if (null == pti) {
          throw new SemanticException(ErrorMsg.PARTITION_COLUMN_NON_PRIMITIVE.getMsg() + " Found "
            + partCol + " of type: " + fs.getType());
        }
        for (String name : colNames) {
          String colName = BaseSemanticAnalyzer.unescapeIdentifier(name);
          if (partCol.equalsIgnoreCase(colName)) {
            throw new SemanticException(
              ErrorMsg.COLUMN_REPEATED_IN_PARTITIONING_COLS.getMsg());
          }
        }
      }
    }

    /* Validate skewed information. */
    ValidationUtility.validateSkewedInformation(colNames, this.getSkewedColNames(),
        this.getSkewedColValues());
  }
@param skewedColValues the skewedColValues to set
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/create/CreateTableDesc.java