code: protected Optional<String> getDatabaseName(Path path) {
      if (!this.props.contains(HIVE_DATABASE_NAME) && !this.props.contains(HIVE_DATABASE_REGEX)) {
        return Optional.<String> absent();
      }
  
      return Optional.<String> of(
          this.dbNamePrefix + getDatabaseOrTableName(path, HIVE_DATABASE_NAME, HIVE_DATABASE_REGEX, this.dbNamePattern)
              + this.dbNameSuffix);
    }
docs: This method first tries to obtain the database name from {@link #HIVE_DATABASE_NAME}.
  If this property is not specified, it then tries to obtain the database name using
  the first group of {@link #HIVE_DATABASE_REGEX}.