Schema:

DATA_SHARING_USAGE

LISTING_CONSUMPTION_DAILY View

This view in the DATA_SHARING_USAGE schema can be used to analyze consumption of shared data associated with listings in a data exchange. The view returns a record for each consumer account that queried data for a given date.

Columns

Column Name

Data Type

Description

EVENT_DATE

DATETIME

Date of the consumption.

EXCHANGE_NAME

VARCHAR

Name of the data exchange the listing belongs to.

SNOWFLAKE_REGION

VARCHAR

Snowflake region where the consumption occurred.

LISTING_NAME

VARCHAR

SQL identifier for the listing.

LISTING_DISPLAY_NAME

VARCHAR

Display name of the listing.

LISTING_GLOBAL_NAME

VARCHAR

Listing global name.

PROVIDER_ACCOUNT_LOCATOR

VARCHAR

Account locator of the share owner.

PROVIDER_ACCOUNT_NAME

VARCHAR

Account name of the share owner.

SHARE_NAME

VARCHAR

Share name.

CONSUMER_ACCOUNT_LOCATOR

VARCHAR

Account locator name of the consumer.

CONSUMER_ACCOUNT_NAME

VARCHAR

Account name of the consumer.

CONSUMER_ORGANIZATION

VARCHAR

Organization name of the consumer.

JOBS

INTEGER

Total jobs run that day on the share.

Usage Notes

  • Latency for the view may be up to 2 days.

  • The data is retained for 365 days (1 year).

Examples

Shows top listings by consumption for a given time period:

 SELECT
   listing_name,
   listing_display_name,
   SUM(jobs) AS jobs
FROM snowflake.data_sharing_usage.listing_consumption_daily
WHERE 1=1
   AND event_date BETWEEN '2021-01-01' AND '2021-01-31'
GROUP BY 1,2
ORDER BY 3 DESC

Shows top consumers by listing:

SELECT
  *,
  ROW_NUMBER() OVER (PARTITION BY listing_name, listing_display_name ORDER BY jobs DESC) AS rank
FROM (
  SELECT
    listing_name,
    listing_display_name,
    consumer_account_locator,
    SUM(jobs) AS jobs
  FROM snowflake.data_sharing_usage.listing_consumption_daily
  WHERE 1=1
    AND event_date BETWEEN '2021-01-01' AND '2021-01-31'
  GROUP BY 1,2,3
)
ORDER BY
  listing_name,
  listing_display_name,
  rank