In addition to views and materialized views, RAW has packages, which are a more advanced mechanism to organize queries in RAW.

Packages are used to organize queries together and have them accessible under a single name.

The Jupyter magic %%package is used to create a package.

Packages can export multiple declarations or functions.

For example:

To use a package in RQL, use the from <package name> import <declaration>, <declaration> syntax.

When defining a package, declarations that are marked as private are not exported.

For example in the following package, a is exported but b is not.

As expected, b is not available.

If a package includes an expression, this can also be imported.

For instance, the following package defines one function but also a final expression:

This is because IMPORT package3 assigns package3 identifier to the expression in end of package3, which is "World".

Next: Data Catalog