Predicate-level detail and query types in LISTING_ACCESS_HISTORY
The LISTING_ACCESS_HISTORY view now provides details on columns used in filters, groupings, and the query types executed by consumers on shared data.
O que mudou
Use cases
Imagine that you share data on the Snowflake Marketplace and want to understand precisely how consumers interact with your tables to optimize your shares. With this update, you can:
- Identify which consumer query types are executed, including data unloads.
- Analyze which columns are used in grouping, aggregation, and filtering clauses.
- Capture predicate values on date and timestamp columns to see how far back consumers query.
How to use
You can query the access history view to check the filter value ranges used by consumers on temporal columns.
select
lah.consumer_account_organization,
lah.consumer_account_name,
sos.value:"objectName"::string as object_name,
filters.value:"columnName"::string as column_name,
min(filters.value:"columnValue"::date) as earliest_filter_value,
max(filters.value:"columnValue"::date) as latest_filter_value,
count(distinct lah.query_token) as n_queries
from SNOWFLAKE.DATA_SHARING_USAGE.LISTING_ACCESS_HISTORY as lah
join lateral flatten(input=>lah.share_objects_accessed) as sos
join lateral flatten(input=>sos.value, path=>'filterObjects') as filters
where true
and lah.query_date >= dateadd('day', -7, current_date())
and filters.value:"columnValue"::date is not null
group by 1,2,3,4
order by 1,2,3,4;
What happens in this code:
- Queries the
SNOWFLAKE.DATA_SHARING_USAGE.LISTING_ACCESS_HISTORYview to retrieve recent query history for shared data. - Uses the
flattenfunction to extract accessed share objects and the contents of thefilterObjectspath. - Filters for records from the last 7 days where a valid date predicate value exists.
- Returns the earliest and latest queried dates by consumer account, grouped by organization, account, object, and column.
Limitations and requirements
- This feature is generally available (GA).
- Latency for the view can be up to 2 days.
- Data is retained for 365 days (1 year).
- For queries predating the
QUERY_TYPEcolumn or unsupported types, values may return as<redacted>orNULL(such as whenIS_APPLICATIONis true).
- data sharing
- listings
- governance
- sql
- snowflake
LISTING_ACCESS_HISTORY improvements (General availability)
Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.
Relacionadas
- SnowflakeGA
Geração de documentos em PDF, Word e PowerPoint no Snowflake CoWork
O Snowflake CoWork agora gera arquivos PDF, Word, PowerPoint e HTML diretamente de suas análises usando a ferramenta de execução de código do Cortex Agent.
snowflake cowork · cortex agent - SnowflakePublic Preview
Cortex Agent SDK para Python e TypeScript no Snowflake
O Cortex Agent SDK permite criar aplicações que utilizam Cortex Agents e Cortex Code em Python e TypeScript.
cortex agents · python - SnowflakeAtualização
Mensagens de erro mais detalhadas na classificação de dados sensíveis
A view DATA_CLASSIFICATION_LATEST agora traz mensagens de erro específicas e códigos do Snowflake para falhas na classificação.
data governance · trust center