Search code examples
amazon-web-servicesamazon-redshiftmaterialized-views

Refresh Materialized Views Redshift


I am running into the following error

    SQL Error [XX000]: ERROR: Assert
  Detail: 
  -----------------------------------------------
  error:  Assert
  code:      1000
  context:   mv_query != "" - Expected non-empty MV CTAS
  query:     0
  location:  refresh.cpp:1570
  process:   padbmaster [pid=14118]

whenever I execute the SQL statement REFRESH MATERIALIZED VIEW <viw_name> in AWS Redshift. The views themselves are not empty so I do not really know how to resolve this. Would appreciate some help here


Solution

  • When you encounter the error, best fix is to drop your views, recreate them and then re-run the refresh materialized views statement.