private void doAutoCreateAndVerify()
      throws SemanticException, AuthException, LoadAnalyzeTypeMismatchException {
    if (schemaCache.getDevice2TimeSeries().isEmpty()) {
      return;
    }

    try {
      if (loadTsFileAnalyzer.isVerifySchema()) {
        makeSureNoDuplicatedMeasurementsInDevices();
      }

      if (loadTsFileAnalyzer.isAutoCreateDatabase()) {
        autoCreateDatabase();
      }

      // schema fetcher will not auto create if config set
      // isAutoCreateSchemaEnabled is false.
      final ISchemaTree schemaTree = autoCreateSchema();

      if (loadTsFileAnalyzer.isVerifySchema()) {
        verifySchema(schemaTree);
      }
    } catch (AuthException e) {
      throw e;
    } catch (LoadAnalyzeTypeMismatchException e) {
      if (loadTsFileAnalyzer.isConvertOnTypeMismatch()) {
        // throw exception to convert data type in the upper layer (LoadTsFileAnalyzer)
        throw e;
      } else {
        handleException(e, loadTsFileAnalyzer.getStatementString());
      }
    } catch (Exception e) {
      handleException(e, loadTsFileAnalyzer.getStatementString());
    }
  }
This can only be invoked after all timeseries in the current tsfile have been processed.
Otherwise, the isAligned status may be wrong.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java