I’m seeing some strange behavior with “limit 100” (or any “limit” additions, not just with “100”). Here is an example I hope makes it clear:
This query:
SELECT
cast(player_start_date as date) as player_start_date,
cast(eventDate as date) as eventDate,
datediff(cast(eventDate as date),cast(player_start_date as date)) as days_between
from "Snowflake".MYDB.RAW."EVENT_GAMETRANSACTION_RAW"
;
Submitted via “Preview”, Dremio returns with this error:
GandivaException: Not a valid date value "2023-07-04 00:00:00.000"
Looking in Snowflake, I see that Dremio sent this query (when run via “Preview”):
SELECT
"EVENT_GAMETRANSACTION_RAW"."PLAYER_START_DATE", "EVENT_GAMETRANSACTION_RAW"."EVENTDATE"
FROM "MYDB"."RAW"."EVENT_GAMETRANSACTION_RAW"
LIMIT 2000
Running that query in directly in Snowflake, I get the following results:
player_start_date eventdate
2023-06-27 "2023-07-04 00:00:00.000"
2023-06-22 "2023-07-04 00:00:00.000"
2023-06-07 "2023-07-04 00:00:00.000"
2023-06-27 "2023-07-04 00:00:00.000"
player_start_date is stored as a “Date” datatype in Snowflake
eventdate is stored as a variant datatype in Snowflake
Generally speaking, it seems the “variant” datatype causes problems for Dremio. It seems like I would need to be able to “force” Dremio to have Snowflake do the datatype conversion, rather than Dremio asking for the raw value from Snowflake. It seems as though Dremio doesn’t actually do the datatype conversion when the column is of a variant datatype.
How should I be approaching this kind of situation?
I don’t see “variant” as a supported datatype here: Data Types | Dremio Documentation