The SQL_STATEMENT_NOT_YET_COMPLETE error will surface if we query a view in Materialize before data exists for that view. It is common to hit this error just after creating a view, particularly in testing or demo code. Since this error is likely transient, we should retry reading from the view instead of failing.
(e: Error)
| 72 | /// Since this error is likely transient, we should retry reading from the view |
| 73 | /// instead of failing. |
| 74 | fn check_error(e: Error) -> Result<()> { |
| 75 | if e.code() == Some(&SqlState::SQL_STATEMENT_NOT_YET_COMPLETE) { |
| 76 | info!("Error querying, will try again... {}", e.to_string()); |
| 77 | Ok(()) |
| 78 | } else { |
| 79 | Err(anyhow::Error::from(e)) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | /// Limit the queries per second against a view in Materialize. |
| 84 | async fn delay_for(elapsed: Duration, delay: Duration) { |
no test coverage detected