Read the contents of two CSV files 'data1.csv' and 'data2.csv' using the `read_csv_auto` function and combine them using `UNION BY NAME`. Ensure that the columns are matched by name rather than position.
COPY (SELECT 'John' AS name, 25 AS age UNION ALL SELECT 'Jane', 30) TO 'data1.csv' (HEADER, FORMAT 'csv'); COPY (SELECT 'Doe' AS name, 40 AS age UNION ALL SELECT 'Smith', 35) TO 'data2.csv' (HEADER, FORMAT 'csv');
```sql
SELECT * FROM read_csv_auto('data1.csv') UNION BY NAME SELECT * FROM read_csv_auto('data2.csv');
```
```sql
SELECT * FROM read_csv_auto('data1.csv') UNION BY NAME SELECT * FROM read_csv_auto('data2.csv');
```