@dbhavesh
I apologize for the lack of explanation.
The ROW_NUMBER function requires ordering over the entire dataset, making it a non-time-based window function. When applied to streaming data, it results in the "NON_TIME_WINDOW_NOT_SUPPORTED_IN_STREAMING" error.
This issue occurs specifically in DLT streaming tables because they continuously process incoming data. However, in the case of materialized views, data is processed as a snapshot at a given point in time, allowing ordering without triggering this error.
If you need to generate sequential numbers, consider either:
- Using a materialized view instead of a streaming table, or
- Defining an IDENTITY column in the table schema, which automatically assigns unique sequential numbers upon data insertion.*
* Databricks Documentation โ Identity Columns in Delta Lake
--------------------------
Takuya Omi (ๅฐพ็พๆๅ)