Scalar sub-queries / limit 1

Hi All,

I face an error in the version 20.1.0-202202061055110045-36733c65 (Community Edition) that I did not face in previous version (like the 15.5.0-202105040508160960-dddd4dca).

It’s impossible to get result from a query like that:

    SELECT t2.col15
    FROM table2 t2
    where t2.year <= t1.year
    order by t2.col15 DESC
    limit 1
) as col15
from table1 t1

The LIMIT clause generates an error.

For sure this kind of queries works fine in previous version. I join the query profil here.

Rgards (20.1 KB)

@cclairmont Thanks for the update, was able to reproduce the issue and confirm that it works in 15.x. Have updated the Engineering team with a bug

Hi @balaji.ramaswamy

Many thanks ! I spent many time trying to understand how my query was not valid.