Skip to content

Commit 47b9908

Browse files
antiguruclaude
andcommitted
Add documentation for CREATEDATAFLOW privilege
Document the new CREATEDATAFLOW privilege which controls whether users can execute queries requiring dataflow rendering on clusters: - Add privilege description explaining when it's needed and use cases - Update GRANT/REVOKE syntax to include CREATEDATAFLOW for clusters - Add to default privileges (PUBLIC gets CREATEDATAFLOW on all clusters) - Add to object privileges table for CLUSTER The privilege is useful in production to restrict users to fast-path queries only, preventing accidental high-latency dataflow rendering. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent ac8b874 commit 47b9908

File tree

6 files changed

+50
-4
lines changed

6 files changed

+50
-4
lines changed

doc/user/content/sql/grant-privilege.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ object type.
2828
For specific cluster(s):
2929

3030
```mzsql
31-
GRANT <USAGE | CREATE | ALL [PRIVILEGES]> [, ... ]
31+
GRANT <USAGE | CREATE | CREATEDATAFLOW | ALL [PRIVILEGES]> [, ... ]
3232
ON CLUSTER <name> [, ...]
3333
TO <role_name> [, ... ];
3434
```
3535

3636
For all clusters:
3737

3838
```mzsql
39-
GRANT <USAGE | CREATE | ALL [PRIVILEGES]> [, ... ]
39+
GRANT <USAGE | CREATE | CREATEDATAFLOW | ALL [PRIVILEGES]> [, ... ]
4040
ON ALL CLUSTERS
4141
TO <role_name> [, ... ];
4242
```

doc/user/content/sql/revoke-privilege.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ object type.
3030
For specific cluster(s):
3131

3232
```mzsql
33-
REVOKE <USAGE | CREATE | ALL [PRIVILEGES]> [, ... ]
33+
REVOKE <USAGE | CREATE | CREATEDATAFLOW | ALL [PRIVILEGES]> [, ... ]
3434
ON CLUSTER <name> [, ...]
3535
FROM <role_name> [, ... ]
3636
;
@@ -39,7 +39,7 @@ FROM <role_name> [, ... ]
3939
For all clusters:
4040

4141
```mzsql
42-
REVOKE <USAGE | CREATE | ALL [PRIVILEGES]> [, ... ]
42+
REVOKE <USAGE | CREATE | CREATEDATAFLOW | ALL [PRIVILEGES]> [, ... ]
4343
ON ALL CLUSTERS
4444
FROM <role_name> [, ... ]
4545
;

doc/user/data/rbac/default_object_privileges.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,17 @@ rows:
1717
When a [data type](/sql/types/) is created (regardless of the owner), all
1818
roles are granted the `USAGE` privilege. However, to use a data type, the
1919
role must also have `USAGE` privilege on the schema containing the type.
20+
21+
- "Default Privilege": "`CREATEDATAFLOW`"
22+
"Object(s)": |
23+
[`CLUSTER`](/concepts/clusters/)
24+
"Object owner": |
25+
`PUBLIC`
26+
"Granted to": |
27+
`PUBLIC`
28+
Description: |
29+
When a [cluster](/concepts/clusters/) is created (regardless of the owner),
30+
all roles are granted the `CREATEDATAFLOW` privilege by default. This ensures
31+
backwards compatibility and allows all users to execute queries that require
32+
dataflow rendering. Administrators can revoke this privilege to restrict
33+
users to only fast-path queries.

doc/user/data/rbac/object_privileges.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ rows:
77
Privileges: |
88
- `USAGE`
99
- `CREATE`
10+
- `CREATEDATAFLOW`
1011
1112
- Object: "`CONNECTION`"
1213
Privileges: |

doc/user/data/rbac/privileges_objects.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,28 @@ rows:
9494
Abbreviation: "`P`"
9595
Applies to: |
9696
- `SYSTEM`
97+
98+
- Privilege: "**CREATEDATAFLOW**"
99+
Description: |
100+
101+
Permission to execute queries that require dataflow rendering on a cluster.
102+
103+
When a query cannot be satisfied by an existing index using a [fast path](/sql/explain-plan/#fast-path-queries),
104+
Materialize must render a temporary dataflow on the cluster. This privilege controls
105+
whether a role is allowed to trigger such dataflow rendering.
106+
107+
Queries that can be answered using existing indexes (with optional map-filter-project
108+
operations) or constant queries (e.g., `SELECT 1 + 1`) do not require this privilege.
109+
110+
This privilege is useful in production environments to prevent users from accidentally
111+
executing high-latency queries that require dataflow rendering, ensuring they only
112+
run queries that can be satisfied by existing indexes.
113+
114+
{{< note >}}
115+
The [persist fast-path optimization](/sql/explain-plan/#fast-path-queries) is still
116+
available even without this privilege, as it does not render a dataflow.
117+
{{</ note >}}
118+
119+
Abbreviation: "`D`"
120+
Applies to: |
121+
- `CLUSTER`

doc/user/data/rbac/public_privileges.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ rows:
1010
- All `*.public` schemas (e.g., `materialize.public`);
1111
- `materialize` database; and
1212
- `quickstart` cluster.
13+
14+
- Privilege: "`CREATEDATAFLOW`"
15+
Description: |
16+
Permission to execute queries that require dataflow rendering.
17+
"On database object(s)": |
18+
- All clusters.

0 commit comments

Comments
 (0)