private void addDbAndTabToOutputs(String[] qualifiedTabName, TableType type,
      boolean isTemporary, Map<String, String> tblProps, StorageFormat storageFormat) throws SemanticException {
    Database database  = getDatabase(qualifiedTabName[0]);
    outputs.add(new WriteEntity(database, WriteEntity.WriteType.DDL_SHARED));

    Table t = new Table(qualifiedTabName[0], qualifiedTabName[1]);
    t.setParameters(tblProps);
    t.setTableType(type);
    t.setTemporary(isTemporary);
    HiveStorageHandler storageHandler = null;
    if (storageFormat.getStorageHandler() != null) {
      try {
        storageHandler = (HiveStorageHandler) ReflectionUtils.newInstance(
                conf.getClassByName(storageFormat.getStorageHandler()), SessionState.get().getConf());
        t.setProperty(META_TABLE_STORAGE, storageHandler.getClass().getName());
      } catch (ClassNotFoundException ex) {
        LOG.error("Class not found. Storage handler will be set to null: "+ex.getMessage() , ex);
      }
    }
    t.setStorageHandler(storageHandler);
    for (Map.Entry<String,String> serdeMap : storageFormat.getSerdeProps().entrySet()){
      t.setSerdeParam(serdeMap.getKey(), serdeMap.getValue());
    }
    WriteType lockType = tblProps != null && Boolean.parseBoolean(tblProps.get(TABLE_IS_CTAS))
        && AcidUtils.isExclusiveCTASEnabled(conf)
        // iceberg CTAS has it's own locking mechanism, therefore we should exclude them
        && (t.getStorageHandler() == null || !t.getStorageHandler().directInsert()) ?
      WriteType.CTAS : WriteType.DDL_NO_LOCK;
    
    outputs.add(new WriteEntity(t, lockType));
  }
Adds entities for create table/create view.
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java