Blocks

Snowflake View Block Reference

The view block is a core block type. It is the equivalent to VIEW in Snowflake.

Properties

  • This block requires you to specify a block name.
  • This block can only be used within schema blocks.
  • This block can only have assignment fields as children.

Schema

The assignment fields available for configuration for this block are:

sql (Required)

Field Type

This field expects a string.

The sql field is required for all view blocks. Inside of it, you will specify the raw SQL string for your view, without the CREATE OR REPLACE VIEW view_name part.

Example

view v1 {
  sql = `(pre_tax_profit, taxes, after_tax_profit) AS
    SELECT revenue - cost, (revenue - cost) * tax_rate, (revenue - cost) * (1.0 - tax_rate)
    FROM table1;`
}
Previous
Table Block