Madhan Neethiraj created ATLAS-1521:
---------------------------------------

             Summary: Update UI to eliminate REST calls to obtain schema data
                 Key: ATLAS-1521
                 URL: https://issues.apache.org/jira/browse/ATLAS-1521
             Project: Atlas
          Issue Type: Improvement
          Components: atlas-webui
    Affects Versions: 0.8-incubating
            Reporter: Madhan Neethiraj


When rendering entity details page, UI makes a REST API call to /schema/{guid} 
to obtain the schema data. For entity types that don't support the notion of 
schema, this REST API call returns an error. When such error is returned, UI 
does not add 'Schema' tab to the details page. When the call returns data, UI 
renders the data in 'Schema' tab.

Given that only few entity-types (like hive_table) support schema, most calls 
to retrieve schema return an error. Having additional schema related 
information in the type can eliminate the need for unnecessary REST calls. 
ATLAS-1517 introduces additional data in 'typeDefOptions' attribute of 
entity-type definition. UI can use the following logic to render the schema tab 
contents:

# Does an entity-type support schema?
  Is {{entityDef.typeDefOptions\[schemaElementsAttribute]}} set and its value 
non empty? If yes, schema is supported else not-supported. For hive_table type, 
this will be set to 'columns' - as shown below:
{code}
      "typeDefOptions": {
        "schemaElementsAttribute": "columns"
      }
{code}

# How does UI get the data to display in schema tab?
  Value of {{entityDef.typeDefOptions\[schemaElementsAttribute]}} will be the 
name of the attribute in the entity being rendered. This attribute should be of 
type array. The value of this attribute will have the data needed to render the 
schema tab

# What are the columns to display in schema tab?
  Each element of the array attribute value will hold an entity/struct 
instance.For example, In case of hive_table, columns attribute will have an 
array of hive_column objects. From each such element, UI should get value of 
attributes listed in {{elementDef.typeDefOptions\[schemaAttributes]}} to render 
the schema table. For example, hive_column will have the following:

{code}
      "typeDefOptions": {
        "schemaAttributes": "[\"name\", \"description\", \"owner\", \"type\", 
\"comment\", \"position\"]"
      }
{code}

The value will be a json-ified string array.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to