code: private ResultSet executeAndReturnEmptyResultIfNotFound(Statement statement, String sql,
                                                            DBMetadataResultSetMetadata metadataType)
    throws SQLException
    {
      ResultSet resultSet;
      try
      {
        resultSet = statement.executeQuery(sql);
      }
      catch (SnowflakeSQLException e)
      {
        if (e.getSQLState().equals(SqlState.NO_DATA) ||
            e.getSQLState().equals(SqlState.BASE_TABLE_OR_VIEW_NOT_FOUND))
        {
          return SnowflakeDatabaseMetaDataResultSet.getEmptyResultSet(metadataType, statement);
        }
        else
        {
          throw e;
        }
      }
      return resultSet;
    }
docs: A small helper function to execute show command to get metadata,
  And if object does not exist, return an empty result set instead of
  throwing a SnowflakeSQLException