Snowflake SQL Tutorial 113 - External And Iceberg Tables - The Refusals Are The Specification

Snowflake SQL · Episode 113

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

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.

Query
SHOW OBJECTS IN SCHEMA PUBLIC;
Result11 rows · 16 columns · scroll →
Everything in the schema, left over from earlier posts in this series.
created_onnamedatabase_nameschema_namekindcommentcluster_byrowsbytesownerretention_timeowner_role_typeis_hybridis_dynamicis_icebergis_interactive
2026-09-29 18:33:38.089000-07:00CUSTOMERSDEMO_DBPUBLICTABLE101536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:36.497000-07:00DEPARTMENTSDEMO_DBPUBLICTABLE41024ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:44.207000-07:00DOCS_XMLDEMO_DBPUBLICTABLE41536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:37.406000-07:00EMPLOYEESDEMO_DBPUBLICTABLE82048ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:40.710000-07:00EVENTS_JSONDEMO_DBPUBLICTABLE43072ACCOUNTADMIN1ROLENNNN
2026-09-27 03:50:28.146000-07:00JSON_LOADEDDEMO_DBPUBLICTABLE112560ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:43.583000-07:00JSON_TEXT_RAWDEMO_DBPUBLICTABLE111536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:38.885000-07:00ORDERSDEMO_DBPUBLICTABLE411536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:39.971000-07:00SALES_RAWDEMO_DBPUBLICTABLE81536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:44.858000-07:00TYPED_SHAPESDEMO_DBPUBLICTABLE22560ACCOUNTADMIN1ROLENNNN
2026-09-27 20:10:07.808000-07:00XML_LOADEDDEMO_DBPUBLICTABLE44096ACCOUNTADMIN1ROLENNNN

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.

Query
SELECT "kind", COUNT(*) AS HOW_MANY
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()))
GROUP BY "kind"
ORDER BY "kind";
Result1 row · 2 columns
kindHOW_MANY
TABLE11

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.

Run this first
SHOW OBJECTS IN SCHEMA PUBLIC;
Result11 rows · 16 columns · scroll →
created_onnamedatabase_nameschema_namekindcommentcluster_byrowsbytesownerretention_timeowner_role_typeis_hybridis_dynamicis_icebergis_interactive
2026-09-29 18:33:38.089000-07:00CUSTOMERSDEMO_DBPUBLICTABLE101536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:36.497000-07:00DEPARTMENTSDEMO_DBPUBLICTABLE41024ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:44.207000-07:00DOCS_XMLDEMO_DBPUBLICTABLE41536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:37.406000-07:00EMPLOYEESDEMO_DBPUBLICTABLE82048ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:40.710000-07:00EVENTS_JSONDEMO_DBPUBLICTABLE43072ACCOUNTADMIN1ROLENNNN
2026-09-27 03:50:28.146000-07:00JSON_LOADEDDEMO_DBPUBLICTABLE112560ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:43.583000-07:00JSON_TEXT_RAWDEMO_DBPUBLICTABLE111536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:38.885000-07:00ORDERSDEMO_DBPUBLICTABLE411536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:39.971000-07:00SALES_RAWDEMO_DBPUBLICTABLE81536ACCOUNTADMIN1ROLENNNN
2026-09-29 18:33:44.858000-07:00TYPED_SHAPESDEMO_DBPUBLICTABLE22560ACCOUNTADMIN1ROLENNNN
2026-09-27 20:10:07.808000-07:00XML_LOADEDDEMO_DBPUBLICTABLE44096ACCOUNTADMIN1ROLENNNN
Query
SELECT "name", "kind", "is_hybrid", "is_dynamic", "is_iceberg"
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()))
ORDER BY "name"
LIMIT 10;
Result10 rows · 5 columns
namekindis_hybridis_dynamicis_iceberg
CUSTOMERSTABLENNN
DEPARTMENTSTABLENNN
DOCS_XMLTABLENNN
EMPLOYEESTABLENNN
EVENTS_JSONTABLENNN
JSON_LOADEDTABLENNN
JSON_TEXT_RAWTABLENNN
ORDERSTABLENNN
SALES_RAWTABLENNN
TYPED_SHAPESTABLENNN

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.

Query
SHOW EXTERNAL TABLES IN SCHEMA PUBLIC;
Result0 rows · 19 columns · scroll →
created_onnamedatabase_nameschema_nameinvalidinvalid_reasonownercommentstagelocationfile_format_namefile_format_typecloudregionnotification_channellast_refreshed_ontable_formatlast_refresh_detailsowner_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.

Query
SELECT COUNT(*) AS EXTERNAL_TABLES_HERE
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));
Result1 row · 1 column
EXTERNAL_TABLES_HERE
0

And there is a catalog view as well, which is a different source answering the same question.

Query
SELECT COUNT(*) AS ROWS_IN_THAT_VIEW
FROM INFORMATION_SCHEMA.EXTERNAL_TABLES;
Result1 row · 1 column
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.

Query
SELECT COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA'
  AND TABLE_NAME = 'EXTERNAL_TABLES'
ORDER BY ORDINAL_POSITION;
Result12 rows · 2 columns
COLUMN_NAMEDATA_TYPE
TABLE_CATALOGTEXT
TABLE_SCHEMATEXT
TABLE_NAMETEXT
TABLE_OWNERTEXT
CREATEDTIMESTAMP_LTZ
LAST_ALTEREDTIMESTAMP_LTZ
LAST_DDLTIMESTAMP_LTZ
LAST_DDL_BYTEXT
COMMENTTEXT
LOCATIONTEXT
FILE_FORMAT_NAMETEXT
FILE_FORMAT_TYPETEXT

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.

Query
SHOW ICEBERG TABLES IN SCHEMA PUBLIC;
Result0 rows · 20 columns · scroll →
created_onnamedatabase_nameschema_nameownerexternal_volume_namecatalog_nameiceberg_table_typecatalog_table_namecatalog_namespacebase_locationcan_write_metadatacommentowner_role_typename_mappingcatalog_sync_nameauto_refresh_statuspartition_specscurrent_partition_spec_idiceberg_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.

Query
SELECT COUNT(*) AS ICEBERG_TABLES_HERE
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));
Result1 row · 1 column
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.

Query
SHOW EXTERNAL VOLUMES;
Result0 rows · 3 columns
nameallow_writescomment
Query
SELECT COUNT(*) AS EXTERNAL_VOLUMES_ON_THIS_ACCOUNT
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));
Result1 row · 1 column
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.

Query
CREATE OR REPLACE STAGE MY_STAGE_T113
  COMMENT = 'episode 113 probe - dropped at the end of this file';
Result1 row · 1 column
status
Stage area MY_STAGE_T113 successfully created.

Created. Let's see how the catalog describes it.

Query
SHOW STAGES LIKE 'MY_STAGE_T113';
Result1 row · 17 columns · scroll →
Scroll the grid sideways for the whole row.
created_onnamedatabase_nameschema_nameurlhas_credentialshas_encryption_keyownercommentregiontypecloudnotification_channelstorage_integrationendpointowner_role_typedirectory_enabled
2026-09-29 18:33:53.082000-07:00MY_STAGE_T113DEMO_DBPUBLICNNACCOUNTADMINepisode 113 probe - dropped at the end of this fileNULLINTERNALNULLNULLNULLNULLROLEN
Query
SELECT "name", "type", "url", "has_credentials", "comment"
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));
Result1 row · 5 columns
nametypeurlhas_credentialscomment
MY_STAGE_T113INTERNALNepisode 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.

Query
SELECT STAGE_NAME, STAGE_TYPE, STAGE_URL, COMMENT
FROM INFORMATION_SCHEMA.STAGES
WHERE STAGE_SCHEMA = 'PUBLIC' AND STAGE_NAME = 'MY_STAGE_T113';
Result1 row · 4 columns
STAGE_NAMESTAGE_TYPESTAGE_URLCOMMENT
MY_STAGE_T113Internal NamedNULLepisode 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.

Query
LIST @MY_STAGE_T113;
Result0 rows · 4 columns
namesizemd5last_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.

Refused
CREATE OR REPLACE EXTERNAL TABLE EXT_T113 (
    FILENAME VARCHAR AS (METADATA$FILENAME)
)
LOCATION = @MY_STAGE_T113
FILE_FORMAT = (TYPE = CSV);
Query failed — Snowflake returned an error
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.

The whole distinction

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.

Refused
CREATE OR REPLACE EXTERNAL TABLE EXT2_T113 (
    FILENAME VARCHAR AS (METADATA$FILENAME)
)
LOCATION = @NO_SUCH_STAGE_T113
FILE_FORMAT = (TYPE = CSV);
Query failed — Snowflake returned an error
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.

Query
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';
Result1 row · 1 column
status
Stage area EXT_STAGE_T113 successfully created.

successfully created. It worked.

Query
SELECT COUNT(*) AS STAGES_WITH_THIS_NAME
FROM INFORMATION_SCHEMA.STAGES
WHERE STAGE_SCHEMA = 'PUBLIC' AND STAGE_NAME = 'EXT_STAGE_T113';
Result1 row · 1 column
STAGES_WITH_THIS_NAME
1

It is really there. And the catalog records the url we gave it.

Query
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;
Result2 rows · 3 columns
STAGE_NAMESTAGE_TYPESTAGE_URL
EXT_STAGE_T113External Nameds3://no-such-bucket-episode-113/
MY_STAGE_T113Internal NamedNULL

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.

Refused
LIST @EXT_STAGE_T113;
Query failed — Snowflake returned an error
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 thing to take away from this post

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.

Refused
CREATE OR REPLACE ICEBERG TABLE ICE_T113 (
    ID    INT,
    LABEL STRING
)
CATALOG = 'SNOWFLAKE'
EXTERNAL_VOLUME = 'NO_SUCH_VOLUME_T113'
BASE_LOCATION = 'ep113/';
Query failed — Snowflake returned an error
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.

Refused
CREATE OR REPLACE ICEBERG TABLE ICE2_T113 (
    ID    INT,
    LABEL STRING
)
CATALOG = 'SNOWFLAKE'
BASE_LOCATION = 'ep113b/';
Query failed — Snowflake returned an error
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.

Query
SELECT COUNT(*) AS ICEBERG_TABLES_LEFT
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'PUBLIC' AND RIGHT(TABLE_NAME, 5) = '_T113';
Result1 row · 1 column
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.

Query
CREATE OR REPLACE TABLE PLAIN_T113 (
    ID    INT,
    LABEL VARCHAR(30)
);
Result1 row · 1 column
status
Table PLAIN_T113 successfully created.
Query
INSERT INTO PLAIN_T113 (ID, LABEL) SELECT 1, 'one'
UNION ALL SELECT 2, 'two';
Result1 row · 1 column
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.

Query
CREATE OR REPLACE FILE FORMAT CSV_FMT_T113
  TYPE = CSV
  FIELD_DELIMITER = ','
  COMMENT = 'episode 113 probe - dropped at the end of this file';
Result1 row · 1 column
status
File format CSV_FMT_T113 successfully created.
Query
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';
Result1 row · 3 columns
FILE_FORMAT_NAMEFILE_FORMAT_TYPECOMMENT
CSV_FMT_T113CSVepisode 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.

Query
COPY INTO @MY_STAGE_T113/ep113/ FROM PLAIN_T113
  FILE_FORMAT = (FORMAT_NAME = 'CSV_FMT_T113')
  OVERWRITE = TRUE;
Result1 row · 3 columns
rows_unloadedinput_bytesoutput_bytes
21232

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.

Query
LIST @MY_STAGE_T113;
Result1 row · 4 columns
namesizemd5last_modified
my_stage_t113/ep113/data_0_0_0.csv.gz48c12b341574e0f76d23af63b59a2ddb4bWed, 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.

Query
SELECT $1 AS FIRST_COLUMN, $2 AS SECOND_COLUMN
FROM @MY_STAGE_T113/ep113/ (FILE_FORMAT => 'CSV_FMT_T113')
ORDER BY $1;
Result2 rows · 2 columns
FIRST_COLUMNSECOND_COLUMN
1one
2two

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.

Query
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;
Result1 row · 3 columns
STAGES_I_MADETABLES_I_MADEROWS_IN_THE_ORDINARY_TABLE
212

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.

Cleanup
-- 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;
Query
REMOVE @MY_STAGE_T113/ep113/;
Result1 row · 2 columns
nameresult
my_stage_t113/ep113/data_0_0_0.csv.gzremoved

REMOVE reports the file and says removed. And the last query of the script checks that nothing is left.

Query
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;
Result1 row · 6 columns · scroll →
THE_DATABASETHE_SCHEMAPROBE_TABLES_LEFTPROBE_STAGES_LEFTPROBE_FORMATS_LEFTDEMO_DB_IS_READABLE
DEMO_DBPUBLIC00010

No probe tables, no probe stages, no probe file formats, and the demo database still reads. Back where we started.

Key points

  • SHOW OBJECTS carries is_hybrid, is_dynamic and is_iceberg, so you can ask an account what kinds of object it really holds.
  • SHOW EXTERNAL TABLES and SHOW ICEBERG TABLES both 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 STAGES reports an empty string for it and the catalog view reports a NULL.
  • 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 LIST before you believe a CREATE 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_LOCATION instead.
  • So EXTERNAL_VOLUME plus 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.gz without being asked. COPY INTO compresses by default.
  • SELECT $1, $2 FROM @stage reads 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.
Next in this series

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.