The following Feldera SQL was generated from a Spark SQL translation but has compiler errors. Fix the Feldera SQL to resolve these errors while keeping it semantically equivalent to the original Spark SQL.
--- Original Spark Schema --- {schema_sql}
--- Original Spark Query --- {query_sql}
--- Failed Feldera SQL --- {feldera_sql}
--- Compiler Errors --- {error_text}