Improved schema inference logic for file globs by attempting the next file only when it makes sense, enhancing reliability and performance.
Why it matters
Previously, the system tried the next file from a glob pattern on any error during schema inference, which could lead to unnecessary retries and inefficiencies. This change refactors the logic to be more selective, reducing redundant file processing and fixing issue #36317.How to use it
This improvement is applied internally in schema inference when reading files using glob patterns. Users benefit automatically without any configuration changes required.