Skip to main content

Working with File and Column Metadata

The following file-level metadata fields are available for the supported file formats:

File MetadataTypeDescription
METADATA$FILENAMEVARCHARThe name of the file from which the row was read
METADATA$FILE_ROW_NUMBERINTThe row number within the file (starting from 0)

These metadata fields are available in:

  • SELECT queries over stages (e.g., SELECT FROM @stage)
  • COPY INTO <table> statements

Detailed Guides for Querying Metadata

File FormatGuide
ParquetQuerying Parquet Files with Metadata
CSVQuerying CSV Files with Metadata
TSVQuerying TSV Files with Metadata
NDJSONQuerying NDJSON Files with Metadata
ORCQuerying ORC Files with Metadata
AvroQuerying Avro Files with Metadata
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today