State Column definition in sys.materializations

dremio ver: 19.0

hi, i m a newbie in dremio,
as sometimes i saw the reflection was successfully built but somehow the query plan didnt hit and use it. I noticed there is a system table to check the materializations status, and there is a column “state” , possible value : “deleted”, “done” and "deprecated ", and my guess below:
deleted => reflection image expired and deleted from S3
deprecated=> will this possible ready for use by query run?
done==> this type reflection is always the 1st prior for dremio to pick for select query run?

besides, if there is the refresh reflection failed in midway, however there are some older active (non-expired) success reflection built few hour ago, can sql hit the older reflection instead of the newer failed one?

Thanks

push push , thxthxthx

Hi @crazyisjen

deleted → Dremio has issued drop table on the materialization and it has been physically removed from the dist storage.
deprecated → The materialization is no longer available for use by the planner. It hasn’t been deleted yet because reflection.deletion.grace_seconds has not been reached. We have this option to allow in-flight queries to drain before physically deleting the materialization.
done → Materialization is registered in the catalog and available for the planner to consider and match on.

For your final question, yes. If the latest REFRESH REFLECTION fails, the last materialization if not expired will still be available for the planner to use. It’ll have a state of DONE still.

2 Likes

super thanks benny! it’s very helpful to solve my unclear area!! :grinning: