I want to update Hive Table column description using Azure Purview Rest API

swapnil kamle 26 Reputation points
2022-04-30T18:00:58.557+00:00

I have scanned Hive Tables using Azure Purview. Now I want to update column description using Azure Purview Rest API. Can anyone please suggest me how I can bulk update the description for scanned Hive Table using Rest API.

Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,257 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,246 Reputation points
    2022-05-04T08:36:37.95+00:00

    Hello @swapnil kamle ,

    Thanks for the question and using MS Q&A platform.

    You may checkout the below options:

    Option1: Use the partial update entity endpoint: Entity - Partial Update Entity By Unique Attributes - REST API (Azure Purview) | Microsoft Learn

    Option2: You can use the bulk entity update endpoint: Entity - Create Or Update Entities - REST API (Azure Purview) | Microsoft Learn

    • Has the benefit of a single REST endpoint call vs many.
    • For some types (not hive_table it looks like) this endpoint requires that you ALSO know the required attributes (e.g. a data-type attribute).
    • You still need to know the qualified names and the existing name of the table. This method will overwrite the name.

    Option3: You can also use PyApacheAtlas’ excel functionality that works like #2 but with the convenience of doing this in Excel.

    198766-image.png

    Sample Code for Option #1 using Partial Update Entities

    from pyapacheatlas.core.client import PurviewClient  
    from azure.identity import AzureCliCredential  
      
    PURVIEW_NAME = "MY_PURVIEW_SERVICE_NAME"  
      
    cred = AzureCliCredential()  
    client = PurviewClient(  
        account_name=PURVIEW_NAME,  
        authentication=cred  
    )  
      
    list_of_qualified_names_and_descriptions = [("qn1", "desc1"), ("qn2", "desc2")]  
    for qualified_name, description in list_of_qualified_names_and_descriptions:  
      
        client.partial_update_entity(  
            typeName="hive_table",  
            qualifiedName=qualified_name,  
            attributes={  
                "description": description  
            }  
        )  
    

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.