Row level security rules and operators

Row level security gives each permission group of a Lake or Warehouse table its own row filter, built from conditions on the table's columns. This page covers what goes into a condition: the fields you can pick, the operators each column type offers, and the value input that appears. For the protection toggle, the Rules and SQL views and saving, see Row level security editor; for where the RLS step sits and who can change it, see Warehouse permissions and row-level security.

Build a condition

  1. In the table's RLS step, add a rule block with New Query.
  2. Pick a field. The list holds the table's columns, shown by their stored names, plus the system columns Source Id, Source System Id and Delete Flag.
  3. Pick an operator. The list follows the column's type, so a text column offers text operators and a number column offers number operators.
  4. Enter the value. The input changes with the field and the operator, as the next sections describe.

For example, a condition can read: field Region, operator =, value EMEA.

A rule block pairs its conditions with the permission groups it filters: choose the permission groups for the block, then add the conditions. Conditions combine with AND or OR, and NOT negates a group.

Operators by column type

The editor sorts each column into one of the groups below. Nullable(...) wrappers and type parameters are ignored, so Nullable(Decimal(38, 18)) behaves like a decimal column and DateTime64(3) like a timestamp.

Column typeOperators offered
integer, bigint, float, decimal=, !=, >, <, >=, <=, in, not in, between, not between, is null, is not null
text, varchar=, !=, in, not in, between, not between, is null, is not null, starts with, does not start with, ends with, does not end with, contains, does not contain
date, timestamp=, !=, >, <, >=, <=, in, not in, between, not between, is null, is not null
boolean=, !=, is null, is not null
Composite or unknown types (arrays, tuples, maps, UUID, enums)The text operators

Which value input appears

The value input follows the field and the operator:

ConditionWhat appears
is null, is not nullNothing to fill in.
in, not inA tag input, typed to the column: text, number, date, decimal or boolean values.
in, not in on Source System IdA picker of the column's values instead of the tag input; choose up to 10 at once, with the hint Select Partitions. The picked values are kept as one comma-separated list.
=, != on Source System IdA picker of the column's values.
between, not between on date or timestampTwo boxes, prefixed From and To.
=, != on booleanA picker with True and False.
Everything elseA single text box.

Small hints in the boxes tell you what to enter: number and decimal for single values, number and number and decimal and decimal for between and not between on those types, text, prefix and suffix for text conditions, YYYY-MM-DD and YYYY-MM-DD HH for dates and timestamps, and True or False for booleans. A numeric column whose name looks like an ID, such as User Id or userId, shows id as its hint instead of number.

What the editor leaves out

Questions, answered

Why do the rule fields show technical column names?

Conditions become part of a SQL script, and the script reads each column by its stored name. That is why the field list shows names such as customer_id and not a display label.

Why can't I pick Security Labels as a rule field?

The Security Labels column drives row level security itself, so it is never offered as a rule field.

Why don't I see the admin group when I choose groups for a rule?

The admin group is hidden from that picker, and the generated script leaves it out of the roles as well.

Why does a text column offer more operators than a number column?

Operators follow the column's type, as the table above shows. Text columns add the pattern operators (starts with, does not start with, ends with, does not end with, contains, does not contain) that number and date columns do not have; boolean columns get only =, != and the null checks.

Why is there no value box next to is null?

is null and is not null ask whether the column has a value at all, so there is nothing to fill in.

What formats do dates and timestamps use?

The box hints read YYYY-MM-DD for dates and YYYY-MM-DD HH for timestamps. With between and not between, two boxes appear, prefixed From and To.

How many values can I pick at once?

For most columns, in and not in use a tag input you fill with values. On Source System Id, the picker holds up to 10 values.

What does the id hint mean?

A numeric column whose name looks like an ID, such as User Id or userId, shows id instead of number as its hint. It is only a hint for what to type.

Can I use an array or UUID column in a rule?

Yes, through the text operators. The editor cannot compare those types as numbers or dates, so it offers =, contains and the other text conditions instead.