Suppose a situation when it is not known if a filter column exists.
t:([]a:`s1`s2`s3; c:1 2 3);
select c from t where null t[`a]
select c from t where null t[`b]
'length
(where null t[`a])~where null t[`b]
1b
It column a
exists, then the select
is ok.
But when I use a filter with column b
(not exists) then I get an error.
- Why is it happening? - I've checked both of
where
results - they are the same - How to resolve this situation?
In QSQL 'where' needs to act on a list of booleans the same length of the table or of count 1. The count of your example is zero
Some examples:
Update: Because you mention the results of 'where', where is wrapped in the QSQL format as opposed to acting independently then the result being applied, so you see the below difference