Skip to content
BENIBIX Learn

External Table

Also known as External Tables

A table that reads files kept in some other place. The data is not copied in.

Think of it like

It is like a book in another library. You can read it there, so you do not bring it home.

Example

Emma's web logs land in object storage each hour. An external table lets her query them with SQL right away.

Why it matters

Data can be queried the moment it lands. There is no copy to pay for or keep in step.

Definition

An external table is a table that reads data from files kept somewhere else. The system keeps only the table's shape: its columns, the file type and where the files are. When you query it, the engine reads the files right where they sit. Dropping the table removes the shape but leaves the files. Most warehouses and query engines can make one.

Example code

sql
CREATE EXTERNAL TABLE web_logs (
  ts     TIMESTAMP,
  status INT,
  url    STRING
)
STORED AS PARQUET
LOCATION 's3://shop-data/logs/';
The table only points at a folder. The files in that folder are the data.
The engine holds the table's shape. The data stays in files where it landed.

Common mistake

Expecting it to be as fast as a normal table. The engine reads raw files each time, so their format and layout matter a lot.

Key takeaways

  1. 1
    Data stays put. The files are never moved.
  2. 2
    Only the shape is stored. The table is just a description.
  3. 3
    Files decide speed. Good formats make fast queries.