Hey,
I have the following problem when trying to add row level security to some of our Materialized views. According to the documentation this feature is still in preview - nevertheless, I try to understand why this doesnt work and how it would be supposed to to work once the feature is live.
So there is a lot of differences when comparing the SQL statements in Notebooks, SQL Editor and DLT. If I run the following query in notebooks it will fail:
CREATE materialized view test_rowfilter
WITH ROW FILTER gold.cost_center_filter on (CostCenter)
AS
select
*
from bronze.some_table
The same query will work for some random reason in SQL editor though.
If I change the first line to
CREATE OR REFRESH MATERIALIZED VIEW
the SQL Editor will fail, but the query will work in DLT assuming I removed the Row Filter clause. According to the docs, everything should just work but it doesnt.
You can try and reproduce this by just playing around with the "OR REFRESH" and "WITH ROW FILTER" statements. You will get a large variety of different error messages depending on the location of where you test it. I wonder why such a feature is even in preview state.
Am I misunderstanding something here maybe?
Our goal would be to have the Query as CREATE OR REFRESH and WITH ROW FILTER running inside of a DLT pipeline.