In this post we are going to cover external tables and Iceberg tables in Snowflake.
An external table is a table definition over files that live in cloud storage Snowflake does not own. An Iceberg table stores its data in open Iceberg format, in storage you provide, which Snowflake calls an external volume. Both of them need storage outside Snowflake.
The account these posts are written on has none of that. No bucket, no credentials, no external volume. So rather than describe the two features out of the documentation, we are going to ask Snowflake for them and read what it says back. The refusals turn out to be the clearest definition of either feature you will get.
We will start by asking the account what it actually holds, and build it up from there. The last part of the post is the honest half: what you can do today with no cloud storage at all.
Every query below was run on a real Snowflake account, and every result you see is the output it gave back.
Episode 113 of the Snowflake SQL: Zero to Hero series on TechBrothersIT.
- Let's ask the account what it actually holds
- Now the columns that name the special kinds
- Are there any external tables here?
- And any Iceberg tables, or anything to build one on?
- Let's make a stage, because both features want one
- Now let's put an external table on it
- And the error most people hit first
- Can we even make an external stage here?
- Now the Iceberg refusals, and only one was the one I expected
- So what can this account do today?
- Can we read the file back with no table at all?
- One last thing: let's tidy up
Let's ask the account what it actually holds
There is no sample data to create for this one. The point of the post is what is not here, so let's have Snowflake state that rather than take my word for it.
SHOW OBJECTS lists tables and views together.
SHOW OBJECTS IN SCHEMA PUBLIC;| created_on | name | database_name | schema_name | kind | comment | cluster_by | rows | bytes | owner | retention_time | owner_role_type | is_hybrid | is_dynamic | is_iceberg | is_interactive |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2026-09-29 18:33:38.089000-07:00 | CUSTOMERS | DEMO_DB | PUBLIC | TABLE | 10 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:36.497000-07:00 | DEPARTMENTS | DEMO_DB | PUBLIC | TABLE | 4 | 1024 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:44.207000-07:00 | DOCS_XML | DEMO_DB | PUBLIC | TABLE | 4 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:37.406000-07:00 | EMPLOYEES | DEMO_DB | PUBLIC | TABLE | 8 | 2048 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:40.710000-07:00 | EVENTS_JSON | DEMO_DB | PUBLIC | TABLE | 4 | 3072 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-27 03:50:28.146000-07:00 | JSON_LOADED | DEMO_DB | PUBLIC | TABLE | 11 | 2560 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:43.583000-07:00 | JSON_TEXT_RAW | DEMO_DB | PUBLIC | TABLE | 11 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:38.885000-07:00 | ORDERS | DEMO_DB | PUBLIC | TABLE | 41 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:39.971000-07:00 | SALES_RAW | DEMO_DB | PUBLIC | TABLE | 8 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:44.858000-07:00 | TYPED_SHAPES | DEMO_DB | PUBLIC | TABLE | 2 | 2560 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-27 20:10:07.808000-07:00 | XML_LOADED | DEMO_DB | PUBLIC | TABLE | 4 | 4096 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N |
That is the whole schema, built up by earlier posts. Let's count it by kind, using the RESULT_SCAN trick from the last post.
SELECT "kind", COUNT(*) AS HOW_MANY
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()))
GROUP BY "kind"
ORDER BY "kind";| kind | HOW_MANY |
|---|---|
| TABLE | 11 |
One row. Everything in here is a plain table and there is nothing else of any kind.
Now the columns that name the special kinds
SHOW OBJECTS has a flag per special kind of table. Let's run it again and read those three columns.
SHOW OBJECTS IN SCHEMA PUBLIC;| created_on | name | database_name | schema_name | kind | comment | cluster_by | rows | bytes | owner | retention_time | owner_role_type | is_hybrid | is_dynamic | is_iceberg | is_interactive |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2026-09-29 18:33:38.089000-07:00 | CUSTOMERS | DEMO_DB | PUBLIC | TABLE | 10 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:36.497000-07:00 | DEPARTMENTS | DEMO_DB | PUBLIC | TABLE | 4 | 1024 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:44.207000-07:00 | DOCS_XML | DEMO_DB | PUBLIC | TABLE | 4 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:37.406000-07:00 | EMPLOYEES | DEMO_DB | PUBLIC | TABLE | 8 | 2048 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:40.710000-07:00 | EVENTS_JSON | DEMO_DB | PUBLIC | TABLE | 4 | 3072 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-27 03:50:28.146000-07:00 | JSON_LOADED | DEMO_DB | PUBLIC | TABLE | 11 | 2560 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:43.583000-07:00 | JSON_TEXT_RAW | DEMO_DB | PUBLIC | TABLE | 11 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:38.885000-07:00 | ORDERS | DEMO_DB | PUBLIC | TABLE | 41 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:39.971000-07:00 | SALES_RAW | DEMO_DB | PUBLIC | TABLE | 8 | 1536 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-29 18:33:44.858000-07:00 | TYPED_SHAPES | DEMO_DB | PUBLIC | TABLE | 2 | 2560 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N | ||
| 2026-09-27 20:10:07.808000-07:00 | XML_LOADED | DEMO_DB | PUBLIC | TABLE | 4 | 4096 | ACCOUNTADMIN | 1 | ROLE | N | N | N | N |
SELECT "name", "kind", "is_hybrid", "is_dynamic", "is_iceberg"
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()))
ORDER BY "name"
LIMIT 10;| name | kind | is_hybrid | is_dynamic | is_iceberg |
|---|---|---|---|---|
| CUSTOMERS | TABLE | N | N | N |
| DEPARTMENTS | TABLE | N | N | N |
| DOCS_XML | TABLE | N | N | N |
| EMPLOYEES | TABLE | N | N | N |
| EVENTS_JSON | TABLE | N | N | N |
| JSON_LOADED | TABLE | N | N | N |
| JSON_TEXT_RAW | TABLE | N | N | N |
| ORDERS | TABLE | N | N | N |
| SALES_RAW | TABLE | N | N | N |
| TYPED_SHAPES | TABLE | N | N | N |
is_hybrid, is_dynamic and is_iceberg, all N on every row. The query ends in a LIMIT 10, so this grid shows ten of the objects and the count above covers the rest.
So SHOW OBJECTS already tells you what sort of thing each object is. If one of these tables were an Iceberg table, this is where it would say so.
Are there any external tables here?
There is a SHOW for them of their own.
SHOW EXTERNAL TABLES IN SCHEMA PUBLIC;| created_on | name | database_name | schema_name | invalid | invalid_reason | owner | comment | stage | location | file_format_name | file_format_type | cloud | region | notification_channel | last_refreshed_on | table_format | last_refresh_details | owner_role_type |
|---|
No rows. But look at the headings: the command returns a long list of columns with nothing underneath them, and those headings are a description of what an external table is. stage, location, file_format_name, cloud, region, notification_channel, last_refreshed_on. Every one of those is about files somewhere else.
Let's count it properly rather than eyeballing an empty grid. This one reads the output of the SHOW above.
SELECT COUNT(*) AS EXTERNAL_TABLES_HERE
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));| EXTERNAL_TABLES_HERE |
|---|
| 0 |
And there is a catalog view as well, which is a different source answering the same question.
SELECT COUNT(*) AS ROWS_IN_THAT_VIEW
FROM INFORMATION_SCHEMA.EXTERNAL_TABLES;| ROWS_IN_THAT_VIEW |
|---|
| 0 |
Also nothing. The view exists even on an account with no external tables at all, and here is every column it has.
SELECT COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA'
AND TABLE_NAME = 'EXTERNAL_TABLES'
ORDER BY ORDINAL_POSITION;| COLUMN_NAME | DATA_TYPE |
|---|---|
| TABLE_CATALOG | TEXT |
| TABLE_SCHEMA | TEXT |
| TABLE_NAME | TEXT |
| TABLE_OWNER | TEXT |
| CREATED | TIMESTAMP_LTZ |
| LAST_ALTERED | TIMESTAMP_LTZ |
| LAST_DDL | TIMESTAMP_LTZ |
| LAST_DDL_BY | TEXT |
| COMMENT | TEXT |
| LOCATION | TEXT |
| FILE_FORMAT_NAME | TEXT |
| FILE_FORMAT_TYPE | TEXT |
LOCATION, FILE_FORMAT_NAME and FILE_FORMAT_TYPE are the three that are not on an ordinary table. That is the shape of the feature, described by the catalog rather than by me.
And any Iceberg tables, or anything to build one on?
Same question, different command.
SHOW ICEBERG TABLES IN SCHEMA PUBLIC;| created_on | name | database_name | schema_name | owner | external_volume_name | catalog_name | iceberg_table_type | catalog_table_name | catalog_namespace | base_location | can_write_metadata | comment | owner_role_type | name_mapping | catalog_sync_name | auto_refresh_status | partition_specs | current_partition_spec_id | iceberg_table_format_version |
|---|
Empty again, and again the headings are the lesson. external_volume_name, catalog_name, base_location, iceberg_table_type, partition_specs. An Iceberg table needs a volume and a catalog, and those two words are going to come back in a minute.
SELECT COUNT(*) AS ICEBERG_TABLES_HERE
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));| ICEBERG_TABLES_HERE |
|---|
| 0 |
An external volume is the object that holds the storage configuration an Iceberg table needs. Let's see whether this account has one.
SHOW EXTERNAL VOLUMES;| name | allow_writes | comment |
|---|
SELECT COUNT(*) AS EXTERNAL_VOLUMES_ON_THIS_ACCOUNT
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));| EXTERNAL_VOLUMES_ON_THIS_ACCOUNT |
|---|
| 0 |
None. So that is the account, stated by Snowflake: no external tables, no Iceberg tables, and nothing to build an Iceberg table on.
Now let's find out exactly what each of those features asks for.
Let's make a stage, because both features want one
A stage is a named place that files live in. An internal stage lives in Snowflake's own storage and needs no credentials, so we can make one here with nothing but a name.
CREATE OR REPLACE STAGE MY_STAGE_T113
COMMENT = 'episode 113 probe - dropped at the end of this file';| status |
|---|
| Stage area MY_STAGE_T113 successfully created. |
Created. Let's see how the catalog describes it.
SHOW STAGES LIKE 'MY_STAGE_T113';| created_on | name | database_name | schema_name | url | has_credentials | has_encryption_key | owner | comment | region | type | cloud | notification_channel | storage_integration | endpoint | owner_role_type | directory_enabled |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2026-09-29 18:33:53.082000-07:00 | MY_STAGE_T113 | DEMO_DB | PUBLIC | N | N | ACCOUNTADMIN | episode 113 probe - dropped at the end of this file | NULL | INTERNAL | NULL | NULL | NULL | NULL | ROLE | N |
SELECT "name", "type", "url", "has_credentials", "comment"
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));| name | type | url | has_credentials | comment |
|---|---|---|---|---|
| MY_STAGE_T113 | INTERNAL | N | episode 113 probe - dropped at the end of this file |
type is INTERNAL, it has no credentials, and the url cell is empty.
The catalog view puts the same facts in slightly different words.
SELECT STAGE_NAME, STAGE_TYPE, STAGE_URL, COMMENT
FROM INFORMATION_SCHEMA.STAGES
WHERE STAGE_SCHEMA = 'PUBLIC' AND STAGE_NAME = 'MY_STAGE_T113';| STAGE_NAME | STAGE_TYPE | STAGE_URL | COMMENT |
|---|---|---|---|
| MY_STAGE_T113 | Internal Named | NULL | episode 113 probe - dropped at the end of this file |
Internal Named, and STAGE_URL is a real NULL here where SHOW STAGES gave an empty string. Same missing url, two different answers, exactly the split we found for comments in the last post.
An internal stage has no url because there is nowhere else to point at. It is Snowflake's storage. Hold on to that, because the whole episode turns on it.
And it is empty, of course.
LIST @MY_STAGE_T113;| name | size | md5 | last_modified |
|---|
Now let's put an external table on it
We have a stage. An external table takes a LOCATION, and a stage is what you put there. So let's try the obvious thing.
CREATE OR REPLACE EXTERNAL TABLE EXT_T113 (
FILENAME VARCHAR AS (METADATA$FILENAME)
)
LOCATION = @MY_STAGE_T113
FILE_FORMAT = (TYPE = CSV);091080 (55000): Cannot use internal stage MY_STAGE_T113 as the location for an external table.
Read that message twice, because it is the definition of the feature in one sentence. Cannot use internal stage MY_STAGE_T113 as the location for an external table.
An external table is for data Snowflake does not own. An internal stage is data Snowflake does own. The two cannot meet, and that is not a limitation to work around. It is what the word external means.
If you have ever wondered what the difference really is between an external table and an ordinary table loaded from a stage, that error is the answer. An ordinary table holds a copy of the data. An external table holds no data at all and reads files that somebody else is responsible for.
And the error most people hit first
Before the interesting refusal there is a boring one, and it is worth having seen it so you recognise it. Let's name a stage that does not exist.
CREATE OR REPLACE EXTERNAL TABLE EXT2_T113 (
FILENAME VARCHAR AS (METADATA$FILENAME)
)
LOCATION = @NO_SUCH_STAGE_T113
FILE_FORMAT = (TYPE = CSV);002003 (02000): SQL compilation error: Stage 'DEMO_DB.PUBLIC.NO_SUCH_STAGE_T113' does not exist or not authorized. Your primary role ACCOUNTADMIN must have at least one privilege granted on STAGE DEMO_DB.PUBLIC.NO_SUCH_STAGE_T113.
does not exist or not authorized. That is the typo error, and it is the same sentence Snowflake uses when the object does exist and your role cannot see it. It will not tell you which.
Can we even make an external stage here?
This is the part I did not expect. An external stage needs a url. We have no bucket, so let's give it the name of one that belongs to nobody and see what happens.
CREATE OR REPLACE STAGE EXT_STAGE_T113
URL = 's3://no-such-bucket-episode-113/'
COMMENT = 'episode 113 probe - dropped at the end of this file';| status |
|---|
| Stage area EXT_STAGE_T113 successfully created. |
successfully created. It worked.
SELECT COUNT(*) AS STAGES_WITH_THIS_NAME
FROM INFORMATION_SCHEMA.STAGES
WHERE STAGE_SCHEMA = 'PUBLIC' AND STAGE_NAME = 'EXT_STAGE_T113';| STAGES_WITH_THIS_NAME |
|---|
| 1 |
It is really there. And the catalog records the url we gave it.
SELECT STAGE_NAME, STAGE_TYPE, STAGE_URL
FROM INFORMATION_SCHEMA.STAGES
WHERE STAGE_SCHEMA = 'PUBLIC'
AND STAGE_NAME IN ('MY_STAGE_T113', 'EXT_STAGE_T113')
ORDER BY STAGE_NAME;| STAGE_NAME | STAGE_TYPE | STAGE_URL |
|---|---|---|
| EXT_STAGE_T113 | External Named | s3://no-such-bucket-episode-113/ |
| MY_STAGE_T113 | Internal Named | NULL |
Two kinds of stage side by side. External Named with a url that goes nowhere, and Internal Named with no url at all.
So Snowflake accepted a url it cannot reach. Does it know? Let's ask it to list the files.
LIST @EXT_STAGE_T113;091017 (22000): S3 bucket 'no-such-bucket-episode-113' does not exist or not authorized.
Now we get the truth. The bucket does not exist, or we are not allowed to see it.
The url is not checked when you create the stage. It is checked when you use it. Which means a CREATE STAGE that reports success tells you nothing at all about whether the storage is reachable. If you are wiring one up, run a LIST against it before you believe it.
Now the Iceberg refusals, and only one was the one I expected
This account has no external volumes, so let's start by naming one that does not exist and see what we get.
CREATE OR REPLACE ICEBERG TABLE ICE_T113 (
ID INT,
LABEL STRING
)
CATALOG = 'SNOWFLAKE'
EXTERNAL_VOLUME = 'NO_SUCH_VOLUME_T113'
BASE_LOCATION = 'ep113/';002003 (02000): SQL compilation error: External volume 'NO_SUCH_VOLUME_T113' does not exist or not authorized. Your primary role ACCOUNTADMIN or one of your secondary roles must have at least one privilege granted on VOLUME NO_SUCH_VOLUME_T113.
External volume 'NO_SUCH_VOLUME_T113' does not exist or not authorized. That is the one I expected, and it is what you get when you mistype a volume name.
Now let's drop the EXTERNAL_VOLUME clause altogether, in case the account has a default one and the whole thing just works. Everything else about the statement is the same.
CREATE OR REPLACE ICEBERG TABLE ICE2_T113 (
ID INT,
LABEL STRING
)
CATALOG = 'SNOWFLAKE'
BASE_LOCATION = 'ep113b/';004571 (0A000): SQL Compilation Error: BASE_LOCATION property is not supported for Iceberg tables using Snowflake Managed Storage.
That is not about a missing volume at all. BASE_LOCATION property is not supported for Iceberg tables using Snowflake Managed Storage.
So with no external volume named, Snowflake read the statement as asking for managed storage — its own. And managed storage does not take a BASE_LOCATION, because there is no outside location to put one in.
Which tells you something the documentation makes you work for. The two are not interchangeable options with a bit of overlap. It is an external volume plus a base location inside it, or managed storage with no base location, and the error tells you which one Snowflake thought you meant.
Neither table was created.
SELECT COUNT(*) AS ICEBERG_TABLES_LEFT
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'PUBLIC' AND RIGHT(TABLE_NAME, 5) = '_T113';| ICEBERG_TABLES_LEFT |
|---|
| 0 |
Nothing from this post is in the schema yet. Both statements were refused outright, so there is no half-built object to clean up.
So what can this account do today?
This is the honest half. No bucket, no credentials, no volume, and there is still a useful amount of this you can run. Let's start with an ordinary table and two rows.
CREATE OR REPLACE TABLE PLAIN_T113 (
ID INT,
LABEL VARCHAR(30)
);| status |
|---|
| Table PLAIN_T113 successfully created. |
INSERT INTO PLAIN_T113 (ID, LABEL) SELECT 1, 'one'
UNION ALL SELECT 2, 'two';| number of rows inserted |
|---|
| 2 |
Now a named file format, which is the object that says how to read or write the file rather than where it is.
CREATE OR REPLACE FILE FORMAT CSV_FMT_T113
TYPE = CSV
FIELD_DELIMITER = ','
COMMENT = 'episode 113 probe - dropped at the end of this file';| status |
|---|
| File format CSV_FMT_T113 successfully created. |
SELECT FILE_FORMAT_NAME, FILE_FORMAT_TYPE, COMMENT
FROM INFORMATION_SCHEMA.FILE_FORMATS
WHERE FILE_FORMAT_SCHEMA = 'PUBLIC' AND FILE_FORMAT_NAME = 'CSV_FMT_T113';| FILE_FORMAT_NAME | FILE_FORMAT_TYPE | COMMENT |
|---|---|---|
| CSV_FMT_T113 | CSV | episode 113 probe - dropped at the end of this file |
Now let's unload the table into the internal stage. COPY INTO with a stage on the left and a table on the right writes files out.
COPY INTO @MY_STAGE_T113/ep113/ FROM PLAIN_T113
FILE_FORMAT = (FORMAT_NAME = 'CSV_FMT_T113')
OVERWRITE = TRUE;| rows_unloaded | input_bytes | output_bytes |
|---|---|---|
| 2 | 12 | 32 |
The statement reports what it did in its own columns: the rows it unloaded, and the bytes in and out. Those are Snowflake's numbers, quoted as they came back, and nothing here is timed.
And the stage is no longer empty.
LIST @MY_STAGE_T113;| name | size | md5 | last_modified |
|---|---|---|---|
| my_stage_t113/ep113/data_0_0_0.csv.gz | 48 | c12b341574e0f76d23af63b59a2ddb4b | Wed, 30 Sep 2026 01:34:00 GMT |
There is the file, with its size and its checksum. Have a look at the end of the name: .csv.gz. We never asked for that. COPY INTO compressed it on the way out, because that is the default. Hold on to it, because Episode 123 is entirely about it.
Can we read the file back with no table at all?
Yes, and this is the bit worth remembering. You can select straight from a stage. The columns have no names in a CSV file, so you ask for them by position with $1 and $2.
SELECT $1 AS FIRST_COLUMN, $2 AS SECOND_COLUMN
FROM @MY_STAGE_T113/ep113/ (FILE_FORMAT => 'CSV_FMT_T113')
ORDER BY $1;| FIRST_COLUMN | SECOND_COLUMN |
|---|---|
| 1 | one |
| 2 | two |
The same rows we put in, out of a compressed file, by position. No external table, no volume, no credentials. A stage and a file format were enough.
Let's count what this one post actually built.
SELECT (SELECT COUNT(*) FROM INFORMATION_SCHEMA.STAGES
WHERE STAGE_SCHEMA = 'PUBLIC' AND RIGHT(STAGE_NAME, 5) = '_T113')
AS STAGES_I_MADE,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'PUBLIC' AND RIGHT(TABLE_NAME, 5) = '_T113')
AS TABLES_I_MADE,
(SELECT COUNT(*) FROM PLAIN_T113) AS ROWS_IN_THE_ORDINARY_TABLE;| STAGES_I_MADE | TABLES_I_MADE | ROWS_IN_THE_ORDINARY_TABLE |
|---|---|---|
| 2 | 1 | 2 |
Two stages, because we made an internal one and an external one. One table, which is the ordinary one. And the rows that went through the file and came back.
One last thing: let's tidy up
The staged file goes first with REMOVE, then everything else. The drops for the external and Iceberg tables are in there even though none of those four was ever created, because a script should clean up after statements that failed as well as ones that worked.
-- Put the schema back the way we found it.
-- The two external tables and the two Iceberg tables were all refused, so
-- these four drops have nothing to do. They are here because a probe file
-- should clean up whether its statements worked or not.
REMOVE @MY_STAGE_T113/ep113/;
DROP TABLE IF EXISTS EXT_T113;
DROP TABLE IF EXISTS EXT2_T113;
DROP TABLE IF EXISTS ICE_T113;
DROP TABLE IF EXISTS ICE2_T113;
DROP TABLE IF EXISTS PLAIN_T113;
DROP FILE FORMAT IF EXISTS CSV_FMT_T113;
DROP STAGE IF EXISTS MY_STAGE_T113;
DROP STAGE IF EXISTS EXT_STAGE_T113;REMOVE @MY_STAGE_T113/ep113/;| name | result |
|---|---|
| my_stage_t113/ep113/data_0_0_0.csv.gz | removed |
REMOVE reports the file and says removed. And the last query of the script checks that nothing is left.
SELECT CURRENT_DATABASE() AS THE_DATABASE,
CURRENT_SCHEMA() AS THE_SCHEMA,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
WHERE RIGHT(TABLE_NAME, 5) = '_T113') AS PROBE_TABLES_LEFT,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.STAGES
WHERE RIGHT(STAGE_NAME, 5) = '_T113') AS PROBE_STAGES_LEFT,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.FILE_FORMATS
WHERE RIGHT(FILE_FORMAT_NAME, 5) = '_T113') AS PROBE_FORMATS_LEFT,
(SELECT COUNT(*) FROM CUSTOMERS) AS DEMO_DB_IS_READABLE;| THE_DATABASE | THE_SCHEMA | PROBE_TABLES_LEFT | PROBE_STAGES_LEFT | PROBE_FORMATS_LEFT | DEMO_DB_IS_READABLE |
|---|---|---|---|---|---|
| DEMO_DB | PUBLIC | 0 | 0 | 0 | 10 |
No probe tables, no probe stages, no probe file formats, and the demo database still reads. Back where we started.
Key points
SHOW OBJECTScarriesis_hybrid,is_dynamicandis_iceberg, so you can ask an account what kinds of object it really holds.SHOW EXTERNAL TABLESandSHOW ICEBERG TABLESboth came back empty here, and their column headings are a good description of each feature.- An external table cannot sit on an internal stage:
Cannot use internal stage ... as the location for an external table. - That refusal is the definition. An external table is for data Snowflake does not own, and an internal stage is Snowflake's own storage.
- An internal stage has no url.
SHOW STAGESreports an empty string for it and the catalog view reports aNULL. - A stage pointing at a bucket that does not exist is created successfully, and the catalog records the url.
- The url is checked when you use the stage, not when you create it. Run a
LISTbefore you believe aCREATE STAGE. - Naming an external volume that does not exist is refused the way you would hope.
- With no volume clause at all, Snowflake reads it as managed storage and refuses
BASE_LOCATIONinstead. - So
EXTERNAL_VOLUMEplus a base location, or managed storage with no base location. The two are not interchangeable, and the error says which one you picked. - With no cloud storage you can still make an internal stage and a file format, unload a table into it with
COPY INTO, and read the file back. - A CSV unload arrives as
.csv.gzwithout being asked.COPY INTOcompresses by default. SELECT $1, $2 FROM @stagereads a staged file by position, with no table in the way.- A probe script should drop the objects its failed statements would have created, and its last query should count what it left behind.
Episode 114 — hybrid tables and CREATE INDEX. The other half of this question: the one kind of Snowflake table that takes an index, what is_hybrid is there to report, and what the account above says when you ask it for one.
Every query and every result grid on this page was captured from a live Snowflake account (version 10.35.101) running the demo script for this episode. The account has no cloud storage, no credentials and no external volume, which is the premise of the post rather than a gap in it: the four refusals are real captured errors and are shown as they came back. The _T113 objects are created and dropped by the script, and the other objects in the grids belong to earlier posts in this series. Empty cells marked empty are empty strings and cells reading NULL are real nulls. Nothing on this page is timed; the byte counts are Snowflake's own report columns, quoted as they came back, and no performance claims are made anywhere in this series. External table behaviour follows the Snowflake CREATE EXTERNAL TABLE documentation.



No comments:
Post a Comment
Note: Only a member of this blog may post a comment.