pinot icon indicating copy to clipboard operation
pinot copied to clipboard

Query With Empty String Literal Fails with IN_SUBQUERY

Open ankitsultana opened this issue 3 years ago • 1 comments

Repro:

select count(*) from baseballStats where 
  IN_SUBQUERY(playerID, 'SELECT ID_SET(playerID) FROM baseballStats WHERE teamID != ''''') limit 10

Is this a known issue? I tried find a ticket here for this but couldn't find any.

ankitsultana avatar Sep 15 '22 05:09 ankitsultana

I don't think this has got anything to do with IN_SUBQUERY.

It will probably fail (for the same reason) if you just run the ID_SET query alone.

Are you trying to do predicate != null ? May be try length() scalar function. ?

select count(*) from baseballStats where 
  IN_SUBQUERY(playerID, 'SELECT ID_SET(playerID) FROM baseballStats WHERE length(teamID) > 0 limit 10

siddharthteotia avatar Sep 15 '22 07:09 siddharthteotia