There's a few alternatives for you.
1. a switch in syntax - I doubt this will make much difference, but worth a shot
SELECT ... FROM parquet.`s3://folder_path`
2. Create a view first then query against it. You should get better errors this way.
CREATE TEMPORARY VIEW parquetTable
USING parquet
OPTIONS (
path "s3://bucket/path",
)
SELECT * FROM parquetTable
3. The clunkiest but most bulletproof. Create an empty Delta table with defined syntax upfront then insert data into it.
CREATE TABLE tableName(
<<your schema here>>
)
INSERT INTO tableName SELECT col_names FROM PARQUET.`s3://folder_path`
Schema inference only infers using the first 1000 rows, if you have more than this, it could explain the failures
Keep in mind that fundamentally parquet doesn't enforce schema on write. You can have anything going into the data and parquet will accept it.
If this becomes an enormous headache, you could build an autoloader pipeline to turn it into Delta files, but if it's a minor pain that happens once a week the syntax above should be enough.