<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Retrieve table/view popularity in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93027#M38615</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/117376"&gt;@filipniziol&lt;/a&gt;&amp;nbsp;Hi Filip, ah ok. So, it is the usage from audit tables that is leveraged to derive popularity score. Thanks for this.&lt;/P&gt;&lt;P&gt;One final check please - we expose views to our users but I like to get popularity of tables and impose some data quality checks for the most popular tables, say, those that have been hit 100 times in a week. If an user is querying a view that has 2 underlying tables, the audit tables will record "getTable" event&amp;nbsp; for those 2 tables as UC query engine will try to parse the view query? Are you aware of this?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Oct 2024 07:41:34 GMT</pubDate>
    <dc:creator>noorbasha534</dc:creator>
    <dc:date>2024-10-08T07:41:34Z</dc:date>
    <item>
      <title>Retrieve table/view popularity</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/92997#M38604</link>
      <description>&lt;P&gt;Dears&lt;/P&gt;&lt;P&gt;Is there a way to retrieve the popularity score of an unity catalog object? I looked at APIs documentation but couldn't find one that serves the need.&lt;/P&gt;&lt;P&gt;Appreciate any thoughts.&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Noor.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 18:59:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/92997#M38604</guid>
      <dc:creator>noorbasha534</dc:creator>
      <dc:date>2024-10-07T18:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve table/view popularity</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93000#M38605</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124839"&gt;@noorbasha534&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can take a look at table insights:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/en/discover/table-insights.html" target="_blank"&gt;https://docs.databricks.com/en/discover/table-insights.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Another option you can try is to use system tables and create based on them custom reports.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 19:35:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93000#M38605</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-10-07T19:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve table/view popularity</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93023#M38612</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/110502"&gt;@szymon_dybczak&lt;/a&gt;&amp;nbsp;I like to retrieve programmatically what is displayed in the UI. If the system tables store the "direct" value of popularity score, please kindly guide me to the relevant table/column.&lt;/P&gt;&lt;P&gt;Appreciate. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 06:49:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93023#M38612</guid>
      <dc:creator>noorbasha534</dc:creator>
      <dc:date>2024-10-08T06:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve table/view popularity</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93025#M38614</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124839"&gt;@noorbasha534&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;You can query system.access.audit table:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
SELECT request_params.full_name_arg AS table_Name, COUNT(*) AS table_usage
FROM
  system.access.audit
WHERE
  action_name = 'getTable'
GROUP BY
  table_name
ORDER BY 
  table_usage DESC&lt;/LI-CODE&gt;&lt;P&gt;The table is in preview not enabled by default. To enable you need to send API call:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Import necessary libraries
import requests

# Define the necessary variables
workspace_url = "&amp;lt;workspace_url&amp;gt;"
metastore_id = "metastore_id"
schema_name = "access"
pat_token = "pat_token"

# Construct the URL for the API request
url = f"https://{workspace_url}/api/2.0/unity-catalog/metastores/{metastore_id}/systemschemas/{schema_name}"

# Set the headers for the HTTP request
headers = {
    "Authorization": f"Bearer {pat_token}"
}

# Make the PUT request to enable access
response = requests.put(url, headers=headers)

# Check the response status
if response.status_code == 200:
    print(f"Access successfully enabled for schema `{schema_name}`.")
elif response.status_code == 401:
    print("Authorization failed. Please check your PAT token.")
else:
    print(f"Failed to enable access: {response.status_code} - {response.text}")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 07:35:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93025#M38614</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-10-08T07:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve table/view popularity</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93027#M38615</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/117376"&gt;@filipniziol&lt;/a&gt;&amp;nbsp;Hi Filip, ah ok. So, it is the usage from audit tables that is leveraged to derive popularity score. Thanks for this.&lt;/P&gt;&lt;P&gt;One final check please - we expose views to our users but I like to get popularity of tables and impose some data quality checks for the most popular tables, say, those that have been hit 100 times in a week. If an user is querying a view that has 2 underlying tables, the audit tables will record "getTable" event&amp;nbsp; for those 2 tables as UC query engine will try to parse the view query? Are you aware of this?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 07:41:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93027#M38615</guid>
      <dc:creator>noorbasha534</dc:creator>
      <dc:date>2024-10-08T07:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve table/view popularity</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93077#M38618</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124839"&gt;@noorbasha534&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes, you are correct. When the query is hitting 2 tables, the audit table should record 2 "getTable" events.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Filip&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 11:05:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93077#M38618</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-10-08T11:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve table/view popularity</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93157#M38633</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/117376"&gt;@filipniziol&lt;/a&gt;&amp;nbsp;Hi Filip, Thank you. I did a quick test. In my environment, the table query (indirect) event is getting registered with "getTemporaryTableCredential". However, the view query (direct) event is with "getTable".&lt;/P&gt;&lt;P&gt;Thanks for your time again. Appreciate the support.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 15:24:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93157#M38633</guid>
      <dc:creator>noorbasha534</dc:creator>
      <dc:date>2024-10-08T15:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve table/view popularity</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93161#M38636</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124839"&gt;@noorbasha534&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Please mark &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/117376"&gt;@filipniziol&lt;/a&gt;&amp;nbsp;answer as a solution for this thread. This will help others with same kind of problem find proper solution faster.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 15:41:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-table-view-popularity/m-p/93161#M38636</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-10-08T15:41:58Z</dc:date>
    </item>
  </channel>
</rss>

