public static void updateTableStatsForCreateTable(Warehouse wh, Database db, Table tbl,
      EnvironmentContext envContext, Configuration conf, Path tblPath, boolean newDir)
      throws MetaException {
    // If the created table is a view, skip generating the stats
    if (MetaStoreUtils.isView(tbl)) {
      return;
    }
    assert tblPath != null;
    if (tbl.isSetDictionary() && tbl.getDictionary().getValues() != null) {
      List<ByteBuffer> values = tbl.getDictionary().getValues().
          remove(StatsSetupConst.STATS_FOR_CREATE_TABLE);
      ByteBuffer buffer;
      if (values != null && values.size() > 0 && (buffer = values.get(0)).hasArray()) {
        String val = new String(buffer.array(), StandardCharsets.UTF_8);
        StatsSetupConst.ColumnStatsSetup statsSetup = StatsSetupConst.ColumnStatsSetup.parseStatsSetup(val);
        if (statsSetup.enabled) {
          try {
            // For an Iceberg table, a new snapshot is generated, so any leftover files would be ignored
            // Set the column stats true in order to make it merge-able
            if (newDir || statsSetup.isIcebergTable ||
                wh.isEmptyDir(tblPath, FileUtils.HIDDEN_FILES_PATH_FILTER)) {
              List<String> columns = statsSetup.columnNames;
              if (columns == null || columns.isEmpty()) {
                columns = getColumnNames(tbl.getSd().getCols());
              }
              StatsSetupConst.setStatsStateForCreateTable(tbl.getParameters(), columns, StatsSetupConst.TRUE);
            }
          } catch (IOException e) {
            LOG.error("Error while checking the table directory: " + tblPath, e);
            throw ExceptionHandler.newMetaException(e);
          }
        }
      }
    }

    if (MetastoreConf.getBoolVar(conf, MetastoreConf.ConfVars.STATS_AUTO_GATHER) && 
            !getBooleanEnvProp(envContext, StatsSetupConst.DO_NOT_UPDATE_STATS)) {
      LOG.debug("Calling updateTableStatsSlow for table {}.{}.{}", tbl.getCatName(), tbl.getDbName(), tbl.getTableName());
      updateTableStatsSlow(db, tbl, wh, newDir, false, envContext);
    }
  }
This method is invalid for MM and ACID tables unless fileStatus comes from AcidUtils.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreServerUtils.java