Dremio cannot pushdown string functions to SQL SERVER

Hey guys,

I’ve identified strange behavior on a SQL Server connection. When I use some string function, Dremio doesn’t send that function to the source. Ex.:

This query:
SELECT MAX(COL_TEXT)
FROM TABLE
WHERE DATE = ‘2021-12-23’

Result in the same function in JDBC SQL.

This query:
SELECT MAX(LENGTH(COL_TEXT))
FROM TABLE
WHERE DATE = ‘2021-12-23’

Results in:
SELECT COL_TEXT
FROM TABLE
WHERE DATE = ‘2021-12-23’

Unfortunately my table has over 200 million rows for a date causing slowing results.

@fbelchior Can you please send us the profile meanwhile we will attempt a repro

WITH STRING FUNCTION.zip (13,4,KB)
WITHOUT STRING FUNCTION.zip (12,7,KB)

Hi guys! Any news on this issue?

@fbelchior I was able to reproduce the same behavior, it looks like we are not pushing down the LENGTH into the scan,

Would you be able to send me the explain plan for the same SQL on SQL Server?

1 Like

Hi @balaji.ramaswamy

Unfortunately I don’t have DBA access to SQL Server.