Description
Extract should process only existing fields of interval types. For example:
spark-sql> SELECT EXTRACT(MONTH FROM INTERVAL '2021-11' YEAR TO MONTH); 11 spark-sql> SELECT EXTRACT(MONTH FROM INTERVAL '2021' YEAR); 0
The last command should fail as the month field doesn't present in INTERVAL YEAR.