Open HyunjoonCho opened 3 years ago
select tags from metric group by tags
This is not valid query - try this
select tags from metric
Thanks for the comment,
select tags from metric
Yeah, this lists tags but what I'm trying to do is filtering out duplicate ones.
To illustrate, if there are tags like below:
["tag1", "tag2", "tag3"], ["tag1", "tag2", "tag3"], ["tag1", "tag2"], ["tag1", "tag2"], ["tag1", "tag2", "tag3"], ["tag4"]
When I do query with above one, it lists all the tags as they are. I want to print out each tags list only once like this:
["tag1", "tag2", "tag3"], ["tag1", "tag2"], ["tag4"]
Is there a proper query for this? Thank you.
hmm I don't think the group by behavior is per array based.
One solution we can think of is to add a function like array_concat
function(not supported yet) to concat all the values in an array to a string then group by it.(Then ordering in the array will result in different groups )
E.g.
SELECT count(*), array_concat(tags) FROM myTable GROUP BY array_concat(tags)
@npawar can we use groovy to achieve this for now?
Hello, I am trying to find which values are stored for a specific field. Works okay with singleField ones, but does not with multiples.
With below schema
gives me list of name field in the table
However,
returns errorCode 200
gives out count of individual tag - I guess
Is there any workaround for this? Thank you