Skip to content

Tag: presto

Presto equivalent of CONCAT_WS

I’m looking for a function in Presto to concat two columns with a separator like underline. Answer Your are looking here for the array_join function, see docs. array_join(x, delimiter, null_replacement) → varchar Concatenates the elements of the given array using the delimiter and an optional string to …

Is there a way to group by part of a datetime column in SQL?

I have a dataframe something like this. is there a way to return a table that sums the dollar values based on the time down to the minute. For example: Notice that the “time” data in the original data set spans over a few days but I am only concerned with the time of day. Thanks Answer I’m n…

What is cardinality() in presto sql?

Does anyone know the purpose of cardinality() function in sql? How does it work with unnest function? SELECT story_id, cardinality(image_tags) AS image_tags, cardinality(comment_tags) as …

Generate list of all dates between x & y

I am tyring to use a solution I found online to generate a table of all dates between yesterday and Jan 1st of the prior year. SELECT CAST(date_column AS DATE) AS DAY FROM ( VALUES (SEQUENCE(…