0

I am trying to profile the data in a azure synapse delta table. One of the things I want to collect is a small sample of field values for each column.

I can do a column by column version and union the results. e.g.

SELECT '_ModifiedDatetime' AS column_name, string(collect_list(_ModifiedDatetime)) FROM (select DISTINCT _ModifiedDatetime from table) TABLESAMPLE (5 ROWS)

Note: The string function is in there to cope with unioning boolean lists

This is laborious. I was hoping someone had a more elegant way of doing this

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
david
  • 7
  • 2
  • Can you provide your sample input data expected results? – Rakesh Govindula May 03 '23 at 12:02
  • In the example above I would like to see something like this column_name, sample_values _ModifiedDatetime,[2017-10-05 03:29:43, 2017-10-15 09:47:35, 2017-10-14 22:17:17, 2017-10-15 12:26:51, 2017-10-05 04:02:24] note: I have added the alias sample_values for the second column that I missed in the sql example above. – david May 18 '23 at 14:20

0 Answers0