Help with arrays


#1

Hi,

Suppose I have a table ‘posts’ with this column:

hash_tags TEXT[] NOT NULL ENCODING DICT(32),

I want to query the posts table to find records where hash_tags contains some string, “test”.

I’ve read http://docs.mapd.com/latest/mapd-core-guide/dml/#array-support but I can’t seem to wrap my head around how to write this query using any of those functions.

Thanks in advance.
BP


#2

Hi,

Glad you pointed that out, the documentation is a bit wonky there. Will get that fixed.

The query should look like this

select some_column from your_table where 'test' = ANY hash_tags

regards


#3

Works like a charm. Thanks!