You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self._query=f"SELECT {column_name} AS value FROM {table_name} GROUP BY value ORDER BY COUNT({column_name}) DESC"
671
+
self._comment=f"All the values that appear in column {column_name} of table {table_name}"
672
+
self._annotation=None
673
+
else:
674
+
self._query=f"SELECT value FROM (SELECT {column_name} AS value FROM {table_name} ORDER BY RANDOM() LIMIT {sample_count}) AS _inner GROUP BY value"
675
+
self._comment=f"The values that appear in column {column_name} of a random sample of {sample_count} rows of table {table_name}"
676
+
self._annotation="sampled"
677
+
else:
678
+
ifsample_countisNone:
679
+
self._query=f"SELECT value FROM (SELECT {column_name} AS value, COUNT({column_name}) AS count FROM {table_name} GROUP BY value) AS _inner WHERE {suppress_count} < count"
680
+
self._comment=f"All the values that appear in column {column_name} of table {table_name} more than {suppress_count} times"
681
+
self._annotation="suppressed"
682
+
else:
683
+
self._query=f"SELECT value FROM (SELECT value, COUNT(value) AS count FROM (SELECT {column_name} AS value FROM {table_name} ORDER BY RANDOM() LIMIT {sample_count}) AS _inner GROUP BY value) AS _inner WHERE {suppress_count} < count"
684
+
self._comment=f"The values that appear more than {suppress_count} times in column {column_name}, out of a random sample of {sample_count} rows of table {table_name}"
text("SELECT v, COUNT(v) AS f FROM (SELECT {column} as v FROM {table} ORDER BY RANDOM() LIMIT {sample_count}) AS _inner GROUP BY v ORDER BY f DESC".format(
780
+
table=table_name,
781
+
column=column_name,
782
+
sample_count=self.SAMPLE_COUNT,
783
+
))
784
+
)
785
+
ifresultsisnotNone:
786
+
values= [] # All values found
787
+
counts= [] # The number or each value
788
+
values_not_suppressed= [] # All values found more than SUPPRESS_COUNT times
789
+
counts_not_suppressed= [] # The number for each value not suppressed
0 commit comments