> For the complete documentation index, see [llms.txt](https://docs.snowddl.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snowddl.com/basic/yaml-configs/stage-file.md).

# STAGE FILE

Stage files are used primarily to maintain packages (e.g. JAR files) for Snowpark functions.

You may put any directories or files in `/<database>/<schema>/stage/<stage_name>/*`

SnowDDL will synchronise files with internal stage automatically.

Example: [GitHub link](https://github.com/littleK0i/SnowDDL/tree/master/snowddl/_config/sample02_01/test_db/test_schema/stage/test_internal_stage) (`test_internal_stage`).

## Usage notes

1. Pre-compiled JAR files for popular libraries can be downloaded directly from [MVN repository](https://mvnrepository.com/).
2. Directory structure is maintained.
3. It is recommended to have multiple small files VS. one large file. Each file is uploaded individually in a separate thread.
4. For each stage file SnowDDL puts an additional empty technical file. It is used to compare local version of file on disk with remote version of file in stage. Technical file is named `<original_name>.<md5_hash>.md5`. Unfortunately, it is not possible to use `md5` provided by Snowflake `LIST` command, since files in internal stages seems to be encrypted or modified in some other way.

## Links

* [PUT](https://docs.snowflake.com/en/sql-reference/sql/put.html)
* [LIST](https://docs.snowflake.com/en/sql-reference/sql/list.html)
* [REMOVE](https://docs.snowflake.com/en/sql-reference/sql/remove.html)
* [Parser & JSON Schema (GitHub)](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/parser/stage.py)
