@@ -1631,7 +1631,9 @@ statement ok
16311631CREATE STATISTICS s FROM all_null
16321632
16331633query T
1634- SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
1634+ SELECT jsonb_pretty(
1635+ regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"statistic_id": [0-9]+', '"statistic_id": 0', 'g')::JSONB
1636+ )
16351637 FROM (
16361638SELECT json_array_elements(statistics) - 'created_at' AS stat
16371639FROM [SHOW STATISTICS USING JSON FOR TABLE all_null]
@@ -1656,7 +1658,8 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE all_null]
16561658 "histo_version": 3,
16571659 "name": "s",
16581660 "null_count": 0,
1659- "row_count": 1
1661+ "row_count": 1,
1662+ "statistic_id": 0
16601663 },
16611664 {
16621665 "avg_size": 0,
@@ -1668,7 +1671,8 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE all_null]
16681671 "histo_version": 3,
16691672 "name": "s",
16701673 "null_count": 1,
1671- "row_count": 1
1674+ "row_count": 1,
1675+ "statistic_id": 0
16721676 }
16731677]
16741678
@@ -1689,7 +1693,9 @@ statement ok
16891693CREATE STATISTICS s FROM greeting_stats
16901694
16911695query T
1692- SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
1696+ SELECT jsonb_pretty(
1697+ regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"statistic_id": [0-9]+', '"statistic_id": 0', 'g')::JSONB
1698+ )
16931699 FROM (
16941700SELECT json_array_elements(statistics) - 'created_at' AS stat
16951701FROM [SHOW STATISTICS USING JSON FOR TABLE greeting_stats]
@@ -1714,7 +1720,8 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE greeting_stats]
17141720 "histo_version": 3,
17151721 "name": "s",
17161722 "null_count": 0,
1717- "row_count": 1
1723+ "row_count": 1,
1724+ "statistic_id": 0
17181725 }
17191726]
17201727
@@ -1877,7 +1884,9 @@ SHOW HISTOGRAM $hist_id_1
18771884upper_bound range_rows distinct_range_rows equal_rows
18781885
18791886query T
1880- SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
1887+ SELECT jsonb_pretty(
1888+ regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"statistic_id": [0-9]+', '"statistic_id": 0', 'g')::JSONB
1889+ )
18811890 FROM (SELECT json_array_elements(statistics) - 'created_at' AS stat
18821891 FROM [SHOW STATISTICS USING JSON FOR TABLE tabula])
18831892----
@@ -1892,7 +1901,8 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
18921901 "histo_version": 3,
18931902 "name": "aristotle",
18941903 "null_count": 0,
1895- "row_count": 0
1904+ "row_count": 0,
1905+ "statistic_id": 0
18961906 },
18971907 {
18981908 "avg_size": 0,
@@ -1904,7 +1914,8 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
19041914 "histo_version": 3,
19051915 "name": "aristotle",
19061916 "null_count": 0,
1907- "row_count": 0
1917+ "row_count": 0,
1918+ "statistic_id": 0
19081919 },
19091920 {
19101921 "avg_size": 0,
@@ -1916,7 +1927,8 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
19161927 "histo_col_type": "",
19171928 "name": "aristotle",
19181929 "null_count": 0,
1919- "row_count": 0
1930+ "row_count": 0,
1931+ "statistic_id": 0
19201932 },
19211933 {
19221934 "avg_size": 0,
@@ -1928,7 +1940,8 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
19281940 "histo_version": 3,
19291941 "name": "aristotle",
19301942 "null_count": 0,
1931- "row_count": 0
1943+ "row_count": 0,
1944+ "statistic_id": 0
19321945 }
19331946]
19341947
@@ -1973,7 +1986,9 @@ SHOW HISTOGRAM $hist_id_1
19731986upper_bound range_rows distinct_range_rows equal_rows
19741987
19751988query T
1976- SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
1989+ SELECT jsonb_pretty(
1990+ regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"statistic_id": [0-9]+', '"statistic_id": 0', 'g')::JSONB
1991+ )
19771992 FROM (SELECT json_array_elements(statistics) - 'created_at' - 'avg_size' AS stat
19781993 FROM [SHOW STATISTICS USING JSON FOR TABLE tabula])
19791994----
@@ -1995,7 +2010,8 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
19952010 "histo_version": 3,
19962011 "name": "locke",
19972012 "null_count": 0,
1998- "row_count": 1
2013+ "row_count": 1,
2014+ "statistic_id": 0
19992015 },
20002016 {
20012017 "columns": [
@@ -2014,7 +2030,8 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
20142030 "histo_version": 3,
20152031 "name": "locke",
20162032 "null_count": 0,
2017- "row_count": 1
2033+ "row_count": 1,
2034+ "statistic_id": 0
20182035 },
20192036 {
20202037 "columns": [
@@ -2025,7 +2042,8 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
20252042 "histo_col_type": "",
20262043 "name": "locke",
20272044 "null_count": 0,
2028- "row_count": 1
2045+ "row_count": 1,
2046+ "statistic_id": 0
20292047 },
20302048 {
20312049 "columns": [
@@ -2036,7 +2054,8 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
20362054 "histo_version": 3,
20372055 "name": "locke",
20382056 "null_count": 1,
2039- "row_count": 1
2057+ "row_count": 1,
2058+ "statistic_id": 0
20402059 }
20412060]
20422061
@@ -2081,7 +2100,9 @@ NULL {rowid} 0 0 0 true
20812100t1_ab {a,b} 0 0 0 false
20822101
20832102query T
2084- SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]'))
2103+ SELECT jsonb_pretty(
2104+ regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"statistic_id": [0-9]+', '"statistic_id": 0', 'g')::JSONB
2105+ )
20852106 FROM (
20862107SELECT json_array_elements(statistics) - 'created_at' AS stat
20872108FROM [SHOW STATISTICS USING JSON FOR TABLE t1]
@@ -2097,7 +2118,8 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE t1]
20972118 "histo_col_type": "INT8",
20982119 "histo_version": 3,
20992120 "null_count": 0,
2100- "row_count": 0
2121+ "row_count": 0,
2122+ "statistic_id": 0
21012123 },
21022124 {
21032125 "avg_size": 0,
@@ -2108,7 +2130,8 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE t1]
21082130 "histo_col_type": "INT8",
21092131 "histo_version": 3,
21102132 "null_count": 0,
2111- "row_count": 0
2133+ "row_count": 0,
2134+ "statistic_id": 0
21122135 },
21132136 {
21142137 "avg_size": 0,
@@ -2119,7 +2142,8 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE t1]
21192142 "histo_col_type": "INT8",
21202143 "histo_version": 3,
21212144 "null_count": 0,
2122- "row_count": 0
2145+ "row_count": 0,
2146+ "statistic_id": 0
21232147 },
21242148 {
21252149 "avg_size": 0,
@@ -2131,7 +2155,8 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE t1]
21312155 "histo_col_type": "",
21322156 "name": "t1_ab",
21332157 "null_count": 0,
2134- "row_count": 0
2158+ "row_count": 0,
2159+ "statistic_id": 0
21352160 }
21362161]
21372162
0 commit comments