Using advanced search

Apache Atlas advanced search lets you use a query language to combine criteria and refine search results.

Advanced search gives you more control over search criteria through the Atlas domain-specific query language.

In the left navigator pane, Search tab, switch to Advanced Search mode by sliding the green toggle button from Basic to Advanced.

Select an entity type if appropriate, then add your query to refine the search results. Here are some examples of advanced search queries:

  • Search for partial names
    from hive_table where name LIKE '*_dim'
  • Search in date ranges

    Note that the entity attributes may contain date fields that are populated from the source while the system attributes contain date fields that are populated when the entity is created in Atlas. The values can be different.

    Entity attribute createTime
    from hive_table where createTime > '2019-01-01' and createTime < '2019-01-03'
    System attribute Create Timestamp
    from hive_table where __timestamp > '2019-01-01' and __timestamp < '2019-01-03'
  • Search for deleted entitiesSystem attributes (with two underscores before the name) are available on all entity types.
    from hive_table where __state = DELETED
  • Search for multiple criteria
    from hdfs_path where isFile = true and name = "Invoice"
  • Return specific metadata
    from hive_table where name = 'customer_dim' select owner, name,
            qualifiedName, createTime
  • Search for entities with classifications
    from hive_table where hive_table isa Dimension select owner, name, qualifiedName

See the advanced search reference for information about the query language and for more examples.

Improved search capabilities for Glossary terms and Relationships

In Atlas, while using the Advanced Search feature, you can now search for entities based on the glossary term, by using the newly introduced hasTerm keyword that allows users to search the entities which are tagged with them. You can also search the entities based on relationship attributes using the where clause.

In order to search for those entities having a specific glossary term, you must add a fully qualified name. For example: {termName}@{glossaryName}. This term gets compared with the qualifiedName attribute of glossary type.

Where as, when you add only the term name, the resultant output will be the available entities with the specific term name. This is irrespective of what type of glossary it is in and would compare with the name attribute of the glossary type.

Additionally, to search for entities related to the referenced entities, you must add the relationship attribute and value to search for in the where clause. For example: To search for tables under a specific database. For example: {relationshipName}.{attributeName} = {value}

Examples of Glossary term filtering:

  • Table hasTerm savingAccount1234
  • Table hasTerm “savingAccount1234@Banking"
  • Table hasTerm “savingAccount1234@Banking" where Table.name = "customer_dim" and tableType = "external"
  • Table hasTerm “savingAccount1234@Banking" select name orderby name desc
  • Table hasTerm “savingAccount1234@Banking" limit 2
  • Table hasTerm “savingAccount1234@Banking" or Table hasTerm "salesTerm@salesGlossary"
  • Table hasTerm “savingAccount1234@Banking" and Table isA Dimension
  • Table hasTerm “savingAccoun1234t@Banking" and db.name = “Sales" or (Table.qualifiedName like "customer")
  • Table where Table hasTerm “savingAccount1234@Banking"
  • Table where (name = "customer_dim" and Table hasTerm “savingAccount1234@Banking")
  • Table hasTerm "savingAccount1234@Banking" select count() as terms

Examples of Relationship attributes filtering:

  • Table where db.name = “Sales4321”
  • Table where name = “customer_dim” select columns
  • Table where columns.name like “sales” and Table isA Dimension
  • Table where db.name = “Sales4321” limit 2
  • Table where db.name = “Sales4321” orderby name asc
  • Table where db.name = “Sales4321” and columns.name like “sales” and Table hasTerm “salesTerm@salesGlossary” - (Combination of both where and hasTerm attribute and keyword respectively.)