VOID column inside STRUCT fails to cast to VARIANT

Dhruv-22
Contributor III

Let's say I have the following dataframe

%sql
CREATE OR REPLACE TEMPORARY VIEW v_temp AS
VALUES (NULL, DATE'2025-12-31'), (NULL, DATE'2026-04-12'), (NULL, DATE'2026-06-23') AS T(PAYMENT_DATE, TRANSACTION_DATE);

SELECT PAYMENT_DATE, TYPEOF(PAYMENT_DATE), TRANSACTION_DATE, TYPEOF(TRANSACTION_DATE)
FROM v_temp;
Dhruv22_0-1785136495855.png

If I try to cast the PAYMENT_DATE column to variant it works fine

Dhruv22_1-1785136581445.png

But, if I put the column inside a struct and then cast it to variant, it fails.

Dhruv22_2-1785136658557.png

Casting to string makes the code work. 

Dhruv22_3-1785136718467.png

 

Since VOID is castable to VARIANT. Why is it failing?