Uploaded image for project: 'Atlas'
  1. Atlas
  2. ATLAS-3139

basic search enhancement to include relationship attributes as well in the result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 1.2.0, 2.0.0
    • atlas-core
    • None

    Description

      Basic-search results should include list of attributes specified in the search-request. This works for attributes that are directly defined in the given entity-type; if an attribute is a relationship attribute (for example: attribute 'table' in type 'hive_column'), its value is not included in the result.

      Request:

      POST api/atlas/v2/search/basic
      { "typeName":"hive_column", "limit":2, "attributes":[ "table", "position" ]}
      

      Response:

      {
        "queryType": "BASIC",
        "searchParameters": {
          "typeName":   "hive_column",
          "limit":      2,
          "attributes": [ "position", "table" ]
        }
        "entities": [
          {
            "guid":            "464d3a2b-b1e0-4731-a924-4286b9e578ba",
            "typeName":        "hive_column",
            "displayText":     "dob",
            "status":          "ACTIVE",
            "attributes": {
              "name":          "dob",
              "owner":         "madhan",
              "position":      2,
              "qualifiedName": "testdb.testtable.dob@cl1"
            }
          },
          {
            "guid":            "1684e785-9200-41d0-843e-e79167a4a6e0",
            "typeName":        "hive_column",
            "displayText":     "name",
            "status":          "ACTIVE",
            "attributes": {
              "name":          "name",
              "owner":         "madhan",
              "position":      1,
              "qualifiedName": "testdb.testtable.name@cl1"
            }
          }
        ]
      }
      

      Expected Response:

      {
        "queryType": "BASIC",
        "searchParameters": {
          "typeName":   "hive_column",
          "limit":      2,
          "attributes": [ "position", "table" ]
        },
        "entities": [
          {
            "guid":        "464d3a2b-b1e0-4731-a924-4286b9e578ba",
            "typeName":    "hive_column",
            "displayText": "dob",
            "status":      "ACTIVE",
            "attributes": {
              "name":          "dob",
              "owner":         "madhan",
              "position":      2,
              "qualifiedName": "testdb.testtable.dob@cl1",
              "table": {
                "guid":     "3b29c9ae-d765-485d-bdba-bde1f9cc6794",
                "typeName": "hive_table",
                "uniqueAttributes": {
                  "qualifiedName": "testdb.testtable@cl1"
                }
              }
            }
          },
          {
            "guid":        "1684e785-9200-41d0-843e-e79167a4a6e0",
            "typeName":    "hive_column",
            "displayText": "name",
            "status":      "ACTIVE",
            "attributes": {
              "name":          "name",
              "owner":         "madhan",
              "position":      1,
              "qualifiedName": "testdb.testtable.name@cl1",
              "table": {
                "guid":     "3b29c9ae-d765-485d-bdba-bde1f9cc6794",
                "typeName": "hive_table",
                "uniqueAttributes": {
                  "qualifiedName": "testdb.testtable@cl1"
                }
              }
            }
          }
        ],
        "referredEntities": {
          "3b29c9ae-d765-485d-bdba-bde1f9cc6794": {
            "guid":        "3b29c9ae-d765-485d-bdba-bde1f9cc6794",
            "typeName":    "hive_table",
            "status":      "ACTIVE",
            "displayText": "testtable",
            "attributes": {
              "createTime":    1555231290000,
              "name":          "testtable",
              "owner":         "madhan",
              "qualifiedName": "testdb.testtable@cl1"
            }
          }
        }
      }
      

      Attachments

        1. ATLAS-3139.patch
          4 kB
          Madhan Neethiraj

        Activity

          People

            madhan Madhan Neethiraj
            madhan Madhan Neethiraj
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: