Skip to main content

SHOW FILE

Description​

This statement is used to display a file created in a database.

Syntax​

SHOW FILE { [ FROM | IN ] <database_name>}

Optional Parameters​

1. <database_name>

Specifies the database to which the file belongs. Uses the current session's database if not specified.

Return Value​

ColumnDescription
FileIdGlobally unique file identifier
DbNameName of the owning database
CatalogUser-defined classification
FileNameName of the file
FileSizeFile size in bytes
IsContentContent existence flag
MD5MD5 checksum of the file

Access Control Requirements​

The user executing this SQL command must possess the following minimum privileges:

PrivilegeObjectNotes
ADMIN_PRIVUser / RoleThe user or role must have access privileges to the database where the file resides to execute this command

Example​

  • View uploaded files in the current session database

    SHOW FILE;
    +-------+--------+----------+--------------------------+----------+-----------+----------------------------------+
    | Id | DbName | Catalog | FileName | FileSize | IsContent | MD5 |
    +-------+--------+----------+--------------------------+----------+-----------+----------------------------------+
    | 12006 | testdb | doris_be | doris_be_metadata_layout | 89349 | true | 9a3f68160b4106b0e923a0aa2fc05599 |
    +-------+--------+----------+--------------------------+----------+-----------+----------------------------------+
  • View uploaded files in specified database

    SHOW FILE FROM example_db;
    +-------+------------+----------+--------------------------+----------+-----------+----------------------------------+
    | Id | DbName | Catalog | FileName | FileSize | IsContent | MD5 |
    +-------+------------+----------+--------------------------+----------+-----------+----------------------------------+
    | 12007 | example_db | doris_fe | doris_fe_metadata_layout | 569373 | true | 10385505d3c0d03f085fea6f8d51adfa |
    | 12008 | example_db | doris_be | doris_be_metadata_layout | 89349 | true | 9a3f68160b4106b0e923a0aa2fc05599 |
    +-------+------------+----------+--------------------------+----------+-----------+----------------------------------+