Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

big query get distinct array of objects

#Declare the function once
#standardSQL
CREATE TEMP FUNCTION dedup(val ANY TYPE) AS ((
  SELECT ARRAY_AGG(t)
  FROM (SELECT DISTINCT * FROM UNNEST(val) v) t
));
Source by copycoding.com #
 
PREVIOUS NEXT
Tagged: #big #query #distinct #array #objects
ADD COMMENT
Topic
Name
4+8 =