all-things-risingwave

Why does psycopg2 return an error with sum() but not with count() in a query involving a materialized view?

I encountered an error with psycopg2 when using sum() in a query with a materialized view, but count() works fine. The error is 'psycopg2.DataError: array does not start with '{'. Why does this happen?

pa

pampero

Asked on Jun 06, 2022

  • The issue you are facing with psycopg2 when using sum() in a query involving a materialized view is likely due to a version problem or a compatibility issue.
  • The error 'psycopg2.DataError: array does not start with '{'' suggests that there might be an unexpected array data format being returned by the query.
  • It's possible that the sum() function in psycopg2 is handling the data differently compared to count(), leading to this error.
  • Check the version of psycopg2 you are using and consider trying different versions to see if the issue persists.
  • Ensure that there are no array data types in the columns of the materialized view that could be causing this error.
Jun 15, 2022Edited by