private void validateStorageFormat(
          StorageFormat storageFormat, Map<String, String> tblProps, boolean partitionTransformSpecExists)
          throws SemanticException {
    HiveStorageHandler handler;
    try {
      handler = HiveUtils.getStorageHandler(conf, storageFormat.getStorageHandler());
    } catch (HiveException e) {
      throw new SemanticException("Failed to load storage handler:  " + e.getMessage());
    }

    if (handler != null) {
      if (partitionTransformSpecExists && !handler.supportsPartitionTransform()) {
        throw new SemanticException("Partition transform is not supported for " + handler.getClass().getName());
      }

      String fileFormatPropertyKey = handler.getFileFormatPropertyKey();
      if (fileFormatPropertyKey != null) {
        if (tblProps != null && tblProps.containsKey(fileFormatPropertyKey) && storageFormat.getSerdeProps() != null &&
                storageFormat.getSerdeProps().containsKey(fileFormatPropertyKey)) {
          String fileFormat = tblProps.get(fileFormatPropertyKey);
          throw new SemanticException(
                  "Provide only one of the following: STORED BY " + fileFormat + " or WITH SERDEPROPERTIES('" +
                          fileFormatPropertyKey + "'='" + fileFormat + "') or" + " TBLPROPERTIES('" + fileFormatPropertyKey
                          + "'='" + fileFormat + "')");
        }
      }
    } else if (partitionTransformSpecExists) {
      throw new SemanticException(ErrorMsg.UNEXPECTED_PARTITION_TRANSFORM_SPEC.getMsg());
    }
  }
Throw an error if the user tries to use the DDL with
hive.internal.ddl.list.bucketing.enable set to false.
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java