@hypequery/protocol-conformance 0.16.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-contract-fixtures.d.ts.map +1 -1
- package/dist/client-contract-fixtures.js +5 -0
- package/fixtures/client-contract-v1/README.md +9 -2
- package/fixtures/client-contract-v1/identities.json +18 -0
- package/fixtures/client-contract-v1/queries.json +137 -0
- package/fixtures/client-contract-v1/query-rejections.json +105 -0
- package/fixtures/client-contract-v1/rejections.json +281 -0
- package/fixtures/client-contract-v1/relations.json +20 -0
- package/fixtures/client-contract-v1/success.json +394 -0
- package/fixtures/deployments-v2/README.md +4 -0
- package/fixtures/deployments-v2/identity.json +5 -0
- package/fixtures/deployments-v2/rejections.json +455 -0
- package/fixtures/deployments-v2/success.json +112 -0
- package/fixtures/deployments-v3/README.md +2 -0
- package/fixtures/deployments-v3/identity.json +2 -1
- package/fixtures/deployments-v3/rejections.json +3 -1
- package/fixtures/deployments-v3/success.json +2 -1
- package/fixtures/expressions-v1/README.md +2 -0
- package/fixtures/expressions-v1/rejections.json +8 -1
- package/fixtures/expressions-v1/success.json +9 -2
- package/package.json +2 -2
|
@@ -1665,5 +1665,460 @@
|
|
|
1665
1665
|
]
|
|
1666
1666
|
},
|
|
1667
1667
|
"error": "HQ_DEPLOYMENT_UNKNOWN_FIELD"
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
"id": "measure-filter-null-check-with-right",
|
|
1671
|
+
"value": {
|
|
1672
|
+
"kind": "hypequery-deployment",
|
|
1673
|
+
"version": 2,
|
|
1674
|
+
"datasets": [
|
|
1675
|
+
{
|
|
1676
|
+
"name": "customers",
|
|
1677
|
+
"source": "customers",
|
|
1678
|
+
"tenant": {
|
|
1679
|
+
"kind": "not-required"
|
|
1680
|
+
},
|
|
1681
|
+
"dimensions": [
|
|
1682
|
+
{
|
|
1683
|
+
"name": "plan",
|
|
1684
|
+
"type": "string",
|
|
1685
|
+
"source": {
|
|
1686
|
+
"kind": "column",
|
|
1687
|
+
"column": "plan"
|
|
1688
|
+
},
|
|
1689
|
+
"filterable": true,
|
|
1690
|
+
"groupable": true
|
|
1691
|
+
},
|
|
1692
|
+
{
|
|
1693
|
+
"name": "churnedAt",
|
|
1694
|
+
"type": "timestamp",
|
|
1695
|
+
"source": {
|
|
1696
|
+
"kind": "column",
|
|
1697
|
+
"column": "churned_at"
|
|
1698
|
+
},
|
|
1699
|
+
"filterable": true,
|
|
1700
|
+
"groupable": true
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
"name": "trial",
|
|
1704
|
+
"type": "boolean",
|
|
1705
|
+
"source": {
|
|
1706
|
+
"kind": "column",
|
|
1707
|
+
"column": "trial"
|
|
1708
|
+
},
|
|
1709
|
+
"filterable": true,
|
|
1710
|
+
"groupable": true
|
|
1711
|
+
}
|
|
1712
|
+
],
|
|
1713
|
+
"measures": [
|
|
1714
|
+
{
|
|
1715
|
+
"name": "churnedCustomers",
|
|
1716
|
+
"aggregation": "count",
|
|
1717
|
+
"field": "id",
|
|
1718
|
+
"filters": [
|
|
1719
|
+
{
|
|
1720
|
+
"kind": "comparison",
|
|
1721
|
+
"operator": "isNotNull",
|
|
1722
|
+
"left": {
|
|
1723
|
+
"kind": "reference",
|
|
1724
|
+
"name": "churned_at"
|
|
1725
|
+
},
|
|
1726
|
+
"right": {
|
|
1727
|
+
"kind": "literal",
|
|
1728
|
+
"value": null
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
]
|
|
1732
|
+
},
|
|
1733
|
+
{
|
|
1734
|
+
"name": "activeCustomers",
|
|
1735
|
+
"aggregation": "count",
|
|
1736
|
+
"field": "id",
|
|
1737
|
+
"filters": [
|
|
1738
|
+
{
|
|
1739
|
+
"kind": "comparison",
|
|
1740
|
+
"operator": "isNull",
|
|
1741
|
+
"left": {
|
|
1742
|
+
"kind": "reference",
|
|
1743
|
+
"name": "churned_at"
|
|
1744
|
+
}
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
"kind": "comparison",
|
|
1748
|
+
"operator": "eq",
|
|
1749
|
+
"left": {
|
|
1750
|
+
"kind": "reference",
|
|
1751
|
+
"name": "trial"
|
|
1752
|
+
},
|
|
1753
|
+
"right": {
|
|
1754
|
+
"kind": "literal",
|
|
1755
|
+
"value": false
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
]
|
|
1759
|
+
}
|
|
1760
|
+
],
|
|
1761
|
+
"filters": [
|
|
1762
|
+
{
|
|
1763
|
+
"name": "churnedAt",
|
|
1764
|
+
"field": "churnedAt",
|
|
1765
|
+
"operators": [
|
|
1766
|
+
"gte",
|
|
1767
|
+
"isNotNull",
|
|
1768
|
+
"isNull"
|
|
1769
|
+
]
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
"name": "trial",
|
|
1773
|
+
"field": "trial",
|
|
1774
|
+
"operators": [
|
|
1775
|
+
"eq",
|
|
1776
|
+
"isNull"
|
|
1777
|
+
]
|
|
1778
|
+
}
|
|
1779
|
+
],
|
|
1780
|
+
"relationships": []
|
|
1781
|
+
}
|
|
1782
|
+
]
|
|
1783
|
+
},
|
|
1784
|
+
"error": "HQ_DEPLOYMENT_INVALID_VALUE"
|
|
1785
|
+
},
|
|
1786
|
+
{
|
|
1787
|
+
"id": "measure-filter-null-check-with-value-right",
|
|
1788
|
+
"value": {
|
|
1789
|
+
"kind": "hypequery-deployment",
|
|
1790
|
+
"version": 2,
|
|
1791
|
+
"datasets": [
|
|
1792
|
+
{
|
|
1793
|
+
"name": "customers",
|
|
1794
|
+
"source": "customers",
|
|
1795
|
+
"tenant": {
|
|
1796
|
+
"kind": "not-required"
|
|
1797
|
+
},
|
|
1798
|
+
"dimensions": [
|
|
1799
|
+
{
|
|
1800
|
+
"name": "plan",
|
|
1801
|
+
"type": "string",
|
|
1802
|
+
"source": {
|
|
1803
|
+
"kind": "column",
|
|
1804
|
+
"column": "plan"
|
|
1805
|
+
},
|
|
1806
|
+
"filterable": true,
|
|
1807
|
+
"groupable": true
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
"name": "churnedAt",
|
|
1811
|
+
"type": "timestamp",
|
|
1812
|
+
"source": {
|
|
1813
|
+
"kind": "column",
|
|
1814
|
+
"column": "churned_at"
|
|
1815
|
+
},
|
|
1816
|
+
"filterable": true,
|
|
1817
|
+
"groupable": true
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
"name": "trial",
|
|
1821
|
+
"type": "boolean",
|
|
1822
|
+
"source": {
|
|
1823
|
+
"kind": "column",
|
|
1824
|
+
"column": "trial"
|
|
1825
|
+
},
|
|
1826
|
+
"filterable": true,
|
|
1827
|
+
"groupable": true
|
|
1828
|
+
}
|
|
1829
|
+
],
|
|
1830
|
+
"measures": [
|
|
1831
|
+
{
|
|
1832
|
+
"name": "churnedCustomers",
|
|
1833
|
+
"aggregation": "count",
|
|
1834
|
+
"field": "id",
|
|
1835
|
+
"filters": [
|
|
1836
|
+
{
|
|
1837
|
+
"kind": "comparison",
|
|
1838
|
+
"operator": "isNotNull",
|
|
1839
|
+
"left": {
|
|
1840
|
+
"kind": "reference",
|
|
1841
|
+
"name": "churned_at"
|
|
1842
|
+
},
|
|
1843
|
+
"right": {
|
|
1844
|
+
"kind": "literal",
|
|
1845
|
+
"value": "1971-01-01"
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
]
|
|
1849
|
+
},
|
|
1850
|
+
{
|
|
1851
|
+
"name": "activeCustomers",
|
|
1852
|
+
"aggregation": "count",
|
|
1853
|
+
"field": "id",
|
|
1854
|
+
"filters": [
|
|
1855
|
+
{
|
|
1856
|
+
"kind": "comparison",
|
|
1857
|
+
"operator": "isNull",
|
|
1858
|
+
"left": {
|
|
1859
|
+
"kind": "reference",
|
|
1860
|
+
"name": "churned_at"
|
|
1861
|
+
}
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
"kind": "comparison",
|
|
1865
|
+
"operator": "eq",
|
|
1866
|
+
"left": {
|
|
1867
|
+
"kind": "reference",
|
|
1868
|
+
"name": "trial"
|
|
1869
|
+
},
|
|
1870
|
+
"right": {
|
|
1871
|
+
"kind": "literal",
|
|
1872
|
+
"value": false
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
]
|
|
1876
|
+
}
|
|
1877
|
+
],
|
|
1878
|
+
"filters": [
|
|
1879
|
+
{
|
|
1880
|
+
"name": "churnedAt",
|
|
1881
|
+
"field": "churnedAt",
|
|
1882
|
+
"operators": [
|
|
1883
|
+
"gte",
|
|
1884
|
+
"isNotNull",
|
|
1885
|
+
"isNull"
|
|
1886
|
+
]
|
|
1887
|
+
},
|
|
1888
|
+
{
|
|
1889
|
+
"name": "trial",
|
|
1890
|
+
"field": "trial",
|
|
1891
|
+
"operators": [
|
|
1892
|
+
"eq",
|
|
1893
|
+
"isNull"
|
|
1894
|
+
]
|
|
1895
|
+
}
|
|
1896
|
+
],
|
|
1897
|
+
"relationships": []
|
|
1898
|
+
}
|
|
1899
|
+
]
|
|
1900
|
+
},
|
|
1901
|
+
"error": "HQ_DEPLOYMENT_INVALID_VALUE"
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
"id": "measure-filter-value-comparison-without-right",
|
|
1905
|
+
"value": {
|
|
1906
|
+
"kind": "hypequery-deployment",
|
|
1907
|
+
"version": 2,
|
|
1908
|
+
"datasets": [
|
|
1909
|
+
{
|
|
1910
|
+
"name": "customers",
|
|
1911
|
+
"source": "customers",
|
|
1912
|
+
"tenant": {
|
|
1913
|
+
"kind": "not-required"
|
|
1914
|
+
},
|
|
1915
|
+
"dimensions": [
|
|
1916
|
+
{
|
|
1917
|
+
"name": "plan",
|
|
1918
|
+
"type": "string",
|
|
1919
|
+
"source": {
|
|
1920
|
+
"kind": "column",
|
|
1921
|
+
"column": "plan"
|
|
1922
|
+
},
|
|
1923
|
+
"filterable": true,
|
|
1924
|
+
"groupable": true
|
|
1925
|
+
},
|
|
1926
|
+
{
|
|
1927
|
+
"name": "churnedAt",
|
|
1928
|
+
"type": "timestamp",
|
|
1929
|
+
"source": {
|
|
1930
|
+
"kind": "column",
|
|
1931
|
+
"column": "churned_at"
|
|
1932
|
+
},
|
|
1933
|
+
"filterable": true,
|
|
1934
|
+
"groupable": true
|
|
1935
|
+
},
|
|
1936
|
+
{
|
|
1937
|
+
"name": "trial",
|
|
1938
|
+
"type": "boolean",
|
|
1939
|
+
"source": {
|
|
1940
|
+
"kind": "column",
|
|
1941
|
+
"column": "trial"
|
|
1942
|
+
},
|
|
1943
|
+
"filterable": true,
|
|
1944
|
+
"groupable": true
|
|
1945
|
+
}
|
|
1946
|
+
],
|
|
1947
|
+
"measures": [
|
|
1948
|
+
{
|
|
1949
|
+
"name": "churnedCustomers",
|
|
1950
|
+
"aggregation": "count",
|
|
1951
|
+
"field": "id",
|
|
1952
|
+
"filters": [
|
|
1953
|
+
{
|
|
1954
|
+
"kind": "comparison",
|
|
1955
|
+
"operator": "isNotNull",
|
|
1956
|
+
"left": {
|
|
1957
|
+
"kind": "reference",
|
|
1958
|
+
"name": "churned_at"
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
]
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
"name": "activeCustomers",
|
|
1965
|
+
"aggregation": "count",
|
|
1966
|
+
"field": "id",
|
|
1967
|
+
"filters": [
|
|
1968
|
+
{
|
|
1969
|
+
"kind": "comparison",
|
|
1970
|
+
"operator": "isNull",
|
|
1971
|
+
"left": {
|
|
1972
|
+
"kind": "reference",
|
|
1973
|
+
"name": "churned_at"
|
|
1974
|
+
}
|
|
1975
|
+
},
|
|
1976
|
+
{
|
|
1977
|
+
"kind": "comparison",
|
|
1978
|
+
"operator": "eq",
|
|
1979
|
+
"left": {
|
|
1980
|
+
"kind": "reference",
|
|
1981
|
+
"name": "trial"
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
]
|
|
1985
|
+
}
|
|
1986
|
+
],
|
|
1987
|
+
"filters": [
|
|
1988
|
+
{
|
|
1989
|
+
"name": "churnedAt",
|
|
1990
|
+
"field": "churnedAt",
|
|
1991
|
+
"operators": [
|
|
1992
|
+
"gte",
|
|
1993
|
+
"isNotNull",
|
|
1994
|
+
"isNull"
|
|
1995
|
+
]
|
|
1996
|
+
},
|
|
1997
|
+
{
|
|
1998
|
+
"name": "trial",
|
|
1999
|
+
"field": "trial",
|
|
2000
|
+
"operators": [
|
|
2001
|
+
"eq",
|
|
2002
|
+
"isNull"
|
|
2003
|
+
]
|
|
2004
|
+
}
|
|
2005
|
+
],
|
|
2006
|
+
"relationships": []
|
|
2007
|
+
}
|
|
2008
|
+
]
|
|
2009
|
+
},
|
|
2010
|
+
"error": "HQ_DEPLOYMENT_INVALID_VALUE"
|
|
2011
|
+
},
|
|
2012
|
+
{
|
|
2013
|
+
"id": "filter-unknown-null-operator",
|
|
2014
|
+
"value": {
|
|
2015
|
+
"kind": "hypequery-deployment",
|
|
2016
|
+
"version": 2,
|
|
2017
|
+
"datasets": [
|
|
2018
|
+
{
|
|
2019
|
+
"name": "customers",
|
|
2020
|
+
"source": "customers",
|
|
2021
|
+
"tenant": {
|
|
2022
|
+
"kind": "not-required"
|
|
2023
|
+
},
|
|
2024
|
+
"dimensions": [
|
|
2025
|
+
{
|
|
2026
|
+
"name": "plan",
|
|
2027
|
+
"type": "string",
|
|
2028
|
+
"source": {
|
|
2029
|
+
"kind": "column",
|
|
2030
|
+
"column": "plan"
|
|
2031
|
+
},
|
|
2032
|
+
"filterable": true,
|
|
2033
|
+
"groupable": true
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
"name": "churnedAt",
|
|
2037
|
+
"type": "timestamp",
|
|
2038
|
+
"source": {
|
|
2039
|
+
"kind": "column",
|
|
2040
|
+
"column": "churned_at"
|
|
2041
|
+
},
|
|
2042
|
+
"filterable": true,
|
|
2043
|
+
"groupable": true
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
"name": "trial",
|
|
2047
|
+
"type": "boolean",
|
|
2048
|
+
"source": {
|
|
2049
|
+
"kind": "column",
|
|
2050
|
+
"column": "trial"
|
|
2051
|
+
},
|
|
2052
|
+
"filterable": true,
|
|
2053
|
+
"groupable": true
|
|
2054
|
+
}
|
|
2055
|
+
],
|
|
2056
|
+
"measures": [
|
|
2057
|
+
{
|
|
2058
|
+
"name": "churnedCustomers",
|
|
2059
|
+
"aggregation": "count",
|
|
2060
|
+
"field": "id",
|
|
2061
|
+
"filters": [
|
|
2062
|
+
{
|
|
2063
|
+
"kind": "comparison",
|
|
2064
|
+
"operator": "isNotNull",
|
|
2065
|
+
"left": {
|
|
2066
|
+
"kind": "reference",
|
|
2067
|
+
"name": "churned_at"
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
]
|
|
2071
|
+
},
|
|
2072
|
+
{
|
|
2073
|
+
"name": "activeCustomers",
|
|
2074
|
+
"aggregation": "count",
|
|
2075
|
+
"field": "id",
|
|
2076
|
+
"filters": [
|
|
2077
|
+
{
|
|
2078
|
+
"kind": "comparison",
|
|
2079
|
+
"operator": "isNull",
|
|
2080
|
+
"left": {
|
|
2081
|
+
"kind": "reference",
|
|
2082
|
+
"name": "churned_at"
|
|
2083
|
+
}
|
|
2084
|
+
},
|
|
2085
|
+
{
|
|
2086
|
+
"kind": "comparison",
|
|
2087
|
+
"operator": "eq",
|
|
2088
|
+
"left": {
|
|
2089
|
+
"kind": "reference",
|
|
2090
|
+
"name": "trial"
|
|
2091
|
+
},
|
|
2092
|
+
"right": {
|
|
2093
|
+
"kind": "literal",
|
|
2094
|
+
"value": false
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
]
|
|
2098
|
+
}
|
|
2099
|
+
],
|
|
2100
|
+
"filters": [
|
|
2101
|
+
{
|
|
2102
|
+
"name": "churnedAt",
|
|
2103
|
+
"field": "churnedAt",
|
|
2104
|
+
"operators": [
|
|
2105
|
+
"isNotNull",
|
|
2106
|
+
"isEmpty"
|
|
2107
|
+
]
|
|
2108
|
+
},
|
|
2109
|
+
{
|
|
2110
|
+
"name": "trial",
|
|
2111
|
+
"field": "trial",
|
|
2112
|
+
"operators": [
|
|
2113
|
+
"eq",
|
|
2114
|
+
"isNull"
|
|
2115
|
+
]
|
|
2116
|
+
}
|
|
2117
|
+
],
|
|
2118
|
+
"relationships": []
|
|
2119
|
+
}
|
|
2120
|
+
]
|
|
2121
|
+
},
|
|
2122
|
+
"error": "HQ_DEPLOYMENT_INVALID_VALUE"
|
|
1668
2123
|
}
|
|
1669
2124
|
]
|
|
@@ -257,5 +257,117 @@
|
|
|
257
257
|
}
|
|
258
258
|
]
|
|
259
259
|
}
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"id": "null-checks",
|
|
263
|
+
"value": {
|
|
264
|
+
"kind": "hypequery-deployment",
|
|
265
|
+
"version": 2,
|
|
266
|
+
"datasets": [
|
|
267
|
+
{
|
|
268
|
+
"name": "customers",
|
|
269
|
+
"source": "customers",
|
|
270
|
+
"tenant": {
|
|
271
|
+
"kind": "not-required"
|
|
272
|
+
},
|
|
273
|
+
"dimensions": [
|
|
274
|
+
{
|
|
275
|
+
"name": "plan",
|
|
276
|
+
"type": "string",
|
|
277
|
+
"source": {
|
|
278
|
+
"kind": "column",
|
|
279
|
+
"column": "plan"
|
|
280
|
+
},
|
|
281
|
+
"filterable": true,
|
|
282
|
+
"groupable": true
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "churnedAt",
|
|
286
|
+
"type": "timestamp",
|
|
287
|
+
"source": {
|
|
288
|
+
"kind": "column",
|
|
289
|
+
"column": "churned_at"
|
|
290
|
+
},
|
|
291
|
+
"filterable": true,
|
|
292
|
+
"groupable": true
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "trial",
|
|
296
|
+
"type": "boolean",
|
|
297
|
+
"source": {
|
|
298
|
+
"kind": "column",
|
|
299
|
+
"column": "trial"
|
|
300
|
+
},
|
|
301
|
+
"filterable": true,
|
|
302
|
+
"groupable": true
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
"measures": [
|
|
306
|
+
{
|
|
307
|
+
"name": "churnedCustomers",
|
|
308
|
+
"aggregation": "count",
|
|
309
|
+
"field": "id",
|
|
310
|
+
"filters": [
|
|
311
|
+
{
|
|
312
|
+
"kind": "comparison",
|
|
313
|
+
"operator": "isNotNull",
|
|
314
|
+
"left": {
|
|
315
|
+
"kind": "reference",
|
|
316
|
+
"name": "churned_at"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"name": "activeCustomers",
|
|
323
|
+
"aggregation": "count",
|
|
324
|
+
"field": "id",
|
|
325
|
+
"filters": [
|
|
326
|
+
{
|
|
327
|
+
"kind": "comparison",
|
|
328
|
+
"operator": "isNull",
|
|
329
|
+
"left": {
|
|
330
|
+
"kind": "reference",
|
|
331
|
+
"name": "churned_at"
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"kind": "comparison",
|
|
336
|
+
"operator": "eq",
|
|
337
|
+
"left": {
|
|
338
|
+
"kind": "reference",
|
|
339
|
+
"name": "trial"
|
|
340
|
+
},
|
|
341
|
+
"right": {
|
|
342
|
+
"kind": "literal",
|
|
343
|
+
"value": false
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"filters": [
|
|
350
|
+
{
|
|
351
|
+
"name": "churnedAt",
|
|
352
|
+
"field": "churnedAt",
|
|
353
|
+
"operators": [
|
|
354
|
+
"gte",
|
|
355
|
+
"isNotNull",
|
|
356
|
+
"isNull"
|
|
357
|
+
]
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"name": "trial",
|
|
361
|
+
"field": "trial",
|
|
362
|
+
"operators": [
|
|
363
|
+
"eq",
|
|
364
|
+
"isNull"
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"relationships": []
|
|
369
|
+
}
|
|
370
|
+
]
|
|
371
|
+
}
|
|
260
372
|
}
|
|
261
373
|
]
|
|
@@ -14,3 +14,5 @@ This family accompanies accepted RFC 0015. It covers what deployment contract 3
|
|
|
14
14
|
The rules that depend on the query grain are consumer checks at query time, not contract rules, so this family does not cover them. These are whole-bucket intervals, `toDate` coarser than the grain, the 1,000-bucket bound, and the required time range.
|
|
15
15
|
|
|
16
16
|
Every case was generated with, and checked against, the TypeScript reference implementation. The Python implementation also passes every case.
|
|
17
|
+
|
|
18
|
+
RFC 0023 added null checks: the `null-checks` success and identity case (measure filters, allowed-filter operators and a segment predicate) and rejections for a segment or measure-filter null check with a `right` operand.
|
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
{"id":"window-and-shift-measures","canonical":"{\"datasets\":[{\"allowedFilters\":[{\"field\":\"status\",\"name\":\"status\",\"operators\":[\"eq\",\"in\"]}],\"dimensions\":[{\"filterable\":true,\"groupable\":true,\"name\":\"tier\",\"source\":{\"column\":\"tier\",\"kind\":\"column\"},\"type\":\"string\"},{\"filterable\":true,\"groupable\":true,\"name\":\"status\",\"source\":{\"column\":\"status\",\"kind\":\"column\"},\"type\":\"string\"},{\"filterable\":true,\"groupable\":true,\"name\":\"amount\",\"source\":{\"column\":\"amount\",\"kind\":\"column\"},\"type\":\"number\"},{\"filterable\":true,\"groupable\":true,\"name\":\"createdAt\",\"source\":{\"column\":\"created_at\",\"kind\":\"column\"},\"type\":\"timestamp\"}],\"measures\":[{\"aggregation\":\"sum\",\"field\":\"amount\",\"filters\":[],\"name\":\"revenue\"},{\"kind\":\"window\",\"measure\":\"revenue\",\"name\":\"revenue7d\",\"requiresTimeRange\":true,\"trailing\":{\"amount\":7,\"unit\":\"day\"}},{\"kind\":\"window\",\"measure\":\"revenue\",\"name\":\"revenueMtd\",\"requiresTimeRange\":true,\"toDate\":\"month\"},{\"cumulative\":true,\"kind\":\"window\",\"measure\":\"revenue\",\"name\":\"revenueRunning\",\"requiresTimeRange\":true},{\"interval\":{\"amount\":1,\"unit\":\"year\"},\"kind\":\"shift\",\"measure\":\"revenue\",\"name\":\"revenuePriorYear\",\"requiresTimeRange\":true},{\"expression\":{\"kind\":\"binary\",\"left\":{\"kind\":\"binary\",\"left\":{\"kind\":\"reference\",\"name\":\"now\"},\"operator\":\"subtract\",\"right\":{\"kind\":\"reference\",\"name\":\"before\"}},\"operator\":\"divide\",\"right\":{\"args\":[{\"kind\":\"reference\",\"name\":\"before\"}],\"function\":\"nullIfZero\",\"kind\":\"call\"}},\"kind\":\"derived\",\"name\":\"revenueGrowth\",\"uses\":[{\"alias\":\"now\",\"measure\":\"revenue\"},{\"alias\":\"before\",\"measure\":\"revenuePriorYear\"}]}],\"name\":\"orders\",\"relationships\":[],\"segments\":[],\"source\":\"orders\",\"tenant\":{\"kind\":\"not-required\"},\"timeField\":\"created_at\"}],\"kind\":\"hypequery-deployment\",\"version\":3}","sha256":"0fa473a785d5699f086b3512f7206ec1280dc8aefdbadacf2e3fbb903327a9b7"},
|
|
10
10
|
{"id":"approximate-window","canonical":"{\"datasets\":[{\"allowedFilters\":[{\"field\":\"status\",\"name\":\"status\",\"operators\":[\"eq\",\"in\"]}],\"dimensions\":[{\"filterable\":true,\"groupable\":true,\"name\":\"tier\",\"source\":{\"column\":\"tier\",\"kind\":\"column\"},\"type\":\"string\"},{\"filterable\":true,\"groupable\":true,\"name\":\"status\",\"source\":{\"column\":\"status\",\"kind\":\"column\"},\"type\":\"string\"},{\"filterable\":true,\"groupable\":true,\"name\":\"amount\",\"source\":{\"column\":\"amount\",\"kind\":\"column\"},\"type\":\"number\"},{\"filterable\":true,\"groupable\":true,\"name\":\"createdAt\",\"source\":{\"column\":\"created_at\",\"kind\":\"column\"},\"type\":\"timestamp\"}],\"measures\":[{\"aggregation\":\"approxCountDistinct\",\"approximate\":true,\"field\":\"user_id\",\"filters\":[],\"name\":\"activeUsers\"},{\"approximate\":true,\"kind\":\"window\",\"measure\":\"activeUsers\",\"name\":\"activeUsers7d\",\"requiresTimeRange\":true,\"trailing\":{\"amount\":7,\"unit\":\"day\"}},{\"approximate\":true,\"interval\":{\"amount\":1,\"unit\":\"week\"},\"kind\":\"shift\",\"measure\":\"activeUsers\",\"name\":\"activeUsersLastWeek\",\"requiresTimeRange\":true}],\"name\":\"orders\",\"relationships\":[],\"segments\":[],\"source\":\"orders\",\"tenant\":{\"kind\":\"not-required\"},\"timeField\":\"created_at\"}],\"kind\":\"hypequery-deployment\",\"version\":3}","sha256":"38248c985f7157ec7cf8fbbb1fe8257272e8930033401c18775f4ad8f7a2eb35"},
|
|
11
11
|
{"id":"approx-count-distinct-without-segments","canonical":"{\"datasets\":[{\"allowedFilters\":[{\"field\":\"status\",\"name\":\"status\",\"operators\":[\"eq\",\"in\"]}],\"dimensions\":[{\"filterable\":true,\"groupable\":true,\"name\":\"tier\",\"source\":{\"column\":\"tier\",\"kind\":\"column\"},\"type\":\"string\"},{\"filterable\":true,\"groupable\":true,\"name\":\"status\",\"source\":{\"column\":\"status\",\"kind\":\"column\"},\"type\":\"string\"},{\"filterable\":true,\"groupable\":true,\"name\":\"amount\",\"source\":{\"column\":\"amount\",\"kind\":\"column\"},\"type\":\"number\"},{\"filterable\":true,\"groupable\":true,\"name\":\"createdAt\",\"source\":{\"column\":\"created_at\",\"kind\":\"column\"},\"type\":\"timestamp\"}],\"measures\":[{\"aggregation\":\"approxCountDistinct\",\"approximate\":true,\"field\":\"user_id\",\"filters\":[],\"name\":\"activeUsers\"},{\"aggregation\":\"approxCountDistinct\",\"approximate\":true,\"field\":\"user_id\",\"filters\":[{\"kind\":\"comparison\",\"left\":{\"kind\":\"reference\",\"name\":\"status\"},\"operator\":\"eq\",\"right\":{\"kind\":\"literal\",\"value\":\"paid\"}}],\"name\":\"approxActiveFiltered\"}],\"name\":\"orders\",\"relationships\":[],\"source\":\"orders\",\"tenant\":{\"kind\":\"not-required\"}}],\"kind\":\"hypequery-deployment\",\"version\":3}","sha256":"6759733b17f8901ffe4a0421246406cdfff8c04bad71e989d1d8af1239515ab2"},
|
|
12
|
-
{"id":"merge-measures","canonical":"{\"datasets\":[{\"allowedFilters\":[],\"dimensions\":[{\"filterable\":true,\"groupable\":true,\"name\":\"day\",\"source\":{\"column\":\"day\",\"kind\":\"column\"},\"type\":\"timestamp\"}],\"measures\":[{\"aggregation\":\"merge\",\"approximate\":true,\"field\":\"users\",\"filters\":[],\"name\":\"active_users\",\"stateFunction\":\"uniq\"},{\"aggregation\":\"merge\",\"field\":\"users\",\"filters\":[],\"name\":\"exact_users\",\"stateFunction\":\"uniqExact\"},{\"aggregation\":\"approxCountDistinct\",\"approximate\":true,\"field\":\"user_id\",\"filters\":[],\"name\":\"approx_users\"}],\"name\":\"daily_active_users\",\"relationships\":[],\"source\":\"daily_active_users\",\"tenant\":{\"kind\":\"not-required\"}}],\"kind\":\"hypequery-deployment\",\"version\":3}","sha256":"43c972e9913d33e6acff3c612f57e2c65fb9eba25c5c2179b7fe885a13955d8d"}
|
|
12
|
+
{"id":"merge-measures","canonical":"{\"datasets\":[{\"allowedFilters\":[],\"dimensions\":[{\"filterable\":true,\"groupable\":true,\"name\":\"day\",\"source\":{\"column\":\"day\",\"kind\":\"column\"},\"type\":\"timestamp\"}],\"measures\":[{\"aggregation\":\"merge\",\"approximate\":true,\"field\":\"users\",\"filters\":[],\"name\":\"active_users\",\"stateFunction\":\"uniq\"},{\"aggregation\":\"merge\",\"field\":\"users\",\"filters\":[],\"name\":\"exact_users\",\"stateFunction\":\"uniqExact\"},{\"aggregation\":\"approxCountDistinct\",\"approximate\":true,\"field\":\"user_id\",\"filters\":[],\"name\":\"approx_users\"}],\"name\":\"daily_active_users\",\"relationships\":[],\"source\":\"daily_active_users\",\"tenant\":{\"kind\":\"not-required\"}}],\"kind\":\"hypequery-deployment\",\"version\":3}","sha256":"43c972e9913d33e6acff3c612f57e2c65fb9eba25c5c2179b7fe885a13955d8d"},
|
|
13
|
+
{"id":"null-checks","canonical":"{\"datasets\":[{\"allowedFilters\":[{\"field\":\"churnedAt\",\"name\":\"churnedAt\",\"operators\":[\"gte\",\"isNotNull\",\"isNull\"]},{\"field\":\"trial\",\"name\":\"trial\",\"operators\":[\"eq\",\"isNull\"]}],\"dimensions\":[{\"filterable\":true,\"groupable\":true,\"name\":\"plan\",\"source\":{\"column\":\"plan\",\"kind\":\"column\"},\"type\":\"string\"},{\"filterable\":true,\"groupable\":true,\"name\":\"churnedAt\",\"source\":{\"column\":\"churned_at\",\"kind\":\"column\"},\"type\":\"timestamp\"},{\"filterable\":true,\"groupable\":true,\"name\":\"trial\",\"source\":{\"column\":\"trial\",\"kind\":\"column\"},\"type\":\"boolean\"}],\"measures\":[{\"aggregation\":\"count\",\"field\":\"id\",\"filters\":[{\"kind\":\"comparison\",\"left\":{\"kind\":\"reference\",\"name\":\"churned_at\"},\"operator\":\"isNotNull\"}],\"name\":\"churnedCustomers\"},{\"aggregation\":\"count\",\"field\":\"id\",\"filters\":[{\"kind\":\"comparison\",\"left\":{\"kind\":\"reference\",\"name\":\"churned_at\"},\"operator\":\"isNull\"},{\"kind\":\"comparison\",\"left\":{\"kind\":\"reference\",\"name\":\"trial\"},\"operator\":\"eq\",\"right\":{\"kind\":\"literal\",\"value\":false}}],\"name\":\"activeCustomers\"}],\"name\":\"customers\",\"relationships\":[],\"segments\":[{\"name\":\"churned\",\"predicate\":{\"kind\":\"comparison\",\"left\":{\"kind\":\"reference\",\"name\":\"churnedAt\"},\"operator\":\"isNotNull\"}}],\"source\":\"customers\",\"tenant\":{\"kind\":\"not-required\"}}],\"kind\":\"hypequery-deployment\",\"version\":3}","sha256":"8562de89084a56ca93fead20031b6c32fa8f54964cb96eea252c76e21373deee"}
|
|
13
14
|
]
|
|
@@ -34,5 +34,7 @@
|
|
|
34
34
|
{"id":"window-missing-time-range-marker","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"orders","source":"orders","tenant":{"kind":"not-required"},"dimensions":[{"name":"tier","type":"string","source":{"kind":"column","column":"tier"},"filterable":true,"groupable":true},{"name":"status","type":"string","source":{"kind":"column","column":"status"},"filterable":true,"groupable":true},{"name":"amount","type":"number","source":{"kind":"column","column":"amount"},"filterable":true,"groupable":true},{"name":"createdAt","type":"timestamp","source":{"kind":"column","column":"created_at"},"filterable":true,"groupable":true}],"measures":[{"name":"revenue","aggregation":"sum","field":"amount","filters":[]},{"kind":"window","name":"revenue7d","measure":"revenue","trailing":{"amount":7,"unit":"day"}},{"kind":"window","requiresTimeRange":true,"name":"revenueMtd","measure":"revenue","toDate":"month"},{"kind":"window","requiresTimeRange":true,"name":"revenueRunning","measure":"revenue","cumulative":true},{"kind":"shift","requiresTimeRange":true,"name":"revenuePriorYear","measure":"revenue","interval":{"amount":1,"unit":"year"}},{"kind":"derived","name":"revenueGrowth","uses":[{"alias":"now","measure":"revenue"},{"alias":"before","measure":"revenuePriorYear"}],"expression":{"kind":"binary","operator":"divide","left":{"kind":"binary","operator":"subtract","left":{"kind":"reference","name":"now"},"right":{"kind":"reference","name":"before"}},"right":{"kind":"call","function":"nullIfZero","args":[{"kind":"reference","name":"before"}]}}}],"allowedFilters":[{"name":"status","field":"status","operators":["eq","in"]}],"segments":[],"relationships":[],"timeField":"created_at"}]},"error":"HQ_DEPLOYMENT_TYPE"},
|
|
35
35
|
{"id":"shift-false-time-range-marker","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"orders","source":"orders","tenant":{"kind":"not-required"},"dimensions":[{"name":"tier","type":"string","source":{"kind":"column","column":"tier"},"filterable":true,"groupable":true},{"name":"status","type":"string","source":{"kind":"column","column":"status"},"filterable":true,"groupable":true},{"name":"amount","type":"number","source":{"kind":"column","column":"amount"},"filterable":true,"groupable":true},{"name":"createdAt","type":"timestamp","source":{"kind":"column","column":"created_at"},"filterable":true,"groupable":true}],"measures":[{"name":"revenue","aggregation":"sum","field":"amount","filters":[]},{"kind":"window","requiresTimeRange":true,"name":"revenue7d","measure":"revenue","trailing":{"amount":7,"unit":"day"}},{"kind":"window","requiresTimeRange":true,"name":"revenueMtd","measure":"revenue","toDate":"month"},{"kind":"window","requiresTimeRange":true,"name":"revenueRunning","measure":"revenue","cumulative":true},{"kind":"shift","requiresTimeRange":false,"name":"revenuePriorYear","measure":"revenue","interval":{"amount":1,"unit":"year"}},{"kind":"derived","name":"revenueGrowth","uses":[{"alias":"now","measure":"revenue"},{"alias":"before","measure":"revenuePriorYear"}],"expression":{"kind":"binary","operator":"divide","left":{"kind":"binary","operator":"subtract","left":{"kind":"reference","name":"now"},"right":{"kind":"reference","name":"before"}},"right":{"kind":"call","function":"nullIfZero","args":[{"kind":"reference","name":"before"}]}}}],"allowedFilters":[{"name":"status","field":"status","operators":["eq","in"]}],"segments":[],"relationships":[],"timeField":"created_at"}]},"error":"HQ_DEPLOYMENT_INVALID_VALUE"},
|
|
36
36
|
{"id":"merge-estimate-missing-approximate","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"daily_active_users","source":"daily_active_users","tenant":{"kind":"not-required"},"dimensions":[{"name":"day","type":"timestamp","source":{"kind":"column","column":"day"},"filterable":true,"groupable":true}],"measures":[{"name":"active_users","aggregation":"merge","field":"users","filters":[],"stateFunction":"uniq"},{"name":"approx_users","aggregation":"approxCountDistinct","field":"user_id","filters":[],"approximate":true}],"allowedFilters":[],"relationships":[]}]},"error":"HQ_DEPLOYMENT_INVALID_VALUE"},
|
|
37
|
-
{"id":"merge-exact-with-approximate","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"daily_active_users","source":"daily_active_users","tenant":{"kind":"not-required"},"dimensions":[{"name":"day","type":"timestamp","source":{"kind":"column","column":"day"},"filterable":true,"groupable":true}],"measures":[{"name":"active_users","aggregation":"merge","field":"users","filters":[],"stateFunction":"uniqExact","approximate":true},{"name":"approx_users","aggregation":"approxCountDistinct","field":"user_id","filters":[],"approximate":true}],"allowedFilters":[],"relationships":[]}]},"error":"HQ_DEPLOYMENT_INVALID_VALUE"}
|
|
37
|
+
{"id":"merge-exact-with-approximate","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"daily_active_users","source":"daily_active_users","tenant":{"kind":"not-required"},"dimensions":[{"name":"day","type":"timestamp","source":{"kind":"column","column":"day"},"filterable":true,"groupable":true}],"measures":[{"name":"active_users","aggregation":"merge","field":"users","filters":[],"stateFunction":"uniqExact","approximate":true},{"name":"approx_users","aggregation":"approxCountDistinct","field":"user_id","filters":[],"approximate":true}],"allowedFilters":[],"relationships":[]}]},"error":"HQ_DEPLOYMENT_INVALID_VALUE"},
|
|
38
|
+
{"id":"segment-null-check-with-right","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"customers","source":"customers","tenant":{"kind":"not-required"},"dimensions":[{"name":"plan","type":"string","source":{"kind":"column","column":"plan"},"filterable":true,"groupable":true},{"name":"churnedAt","type":"timestamp","source":{"kind":"column","column":"churned_at"},"filterable":true,"groupable":true},{"name":"trial","type":"boolean","source":{"kind":"column","column":"trial"},"filterable":true,"groupable":true}],"measures":[{"name":"churnedCustomers","aggregation":"count","field":"id","filters":[{"kind":"comparison","operator":"isNotNull","left":{"kind":"reference","name":"churned_at"}}]},{"name":"activeCustomers","aggregation":"count","field":"id","filters":[{"kind":"comparison","operator":"isNull","left":{"kind":"reference","name":"churned_at"}},{"kind":"comparison","operator":"eq","left":{"kind":"reference","name":"trial"},"right":{"kind":"literal","value":false}}]}],"allowedFilters":[{"name":"churnedAt","field":"churnedAt","operators":["gte","isNotNull","isNull"]},{"name":"trial","field":"trial","operators":["eq","isNull"]}],"segments":[{"name":"churned","predicate":{"kind":"comparison","operator":"isNotNull","left":{"kind":"reference","name":"churnedAt"},"right":{"kind":"literal","value":null}}}],"relationships":[]}]},"error":"HQ_DEPLOYMENT_INVALID_VALUE"},
|
|
39
|
+
{"id":"measure-filter-null-check-with-right","value":{"kind":"hypequery-deployment","version":3,"datasets":[{"name":"customers","source":"customers","tenant":{"kind":"not-required"},"dimensions":[{"name":"plan","type":"string","source":{"kind":"column","column":"plan"},"filterable":true,"groupable":true},{"name":"churnedAt","type":"timestamp","source":{"kind":"column","column":"churned_at"},"filterable":true,"groupable":true},{"name":"trial","type":"boolean","source":{"kind":"column","column":"trial"},"filterable":true,"groupable":true}],"measures":[{"name":"churnedCustomers","aggregation":"count","field":"id","filters":[{"kind":"comparison","operator":"isNotNull","left":{"kind":"reference","name":"churned_at"},"right":{"kind":"literal","value":"1971-01-01"}}]},{"name":"activeCustomers","aggregation":"count","field":"id","filters":[{"kind":"comparison","operator":"isNull","left":{"kind":"reference","name":"churned_at"}},{"kind":"comparison","operator":"eq","left":{"kind":"reference","name":"trial"},"right":{"kind":"literal","value":false}}]}],"allowedFilters":[{"name":"churnedAt","field":"churnedAt","operators":["gte","isNotNull","isNull"]},{"name":"trial","field":"trial","operators":["eq","isNull"]}],"segments":[{"name":"churned","predicate":{"kind":"comparison","operator":"isNotNull","left":{"kind":"reference","name":"churnedAt"}}}],"relationships":[]}]},"error":"HQ_DEPLOYMENT_INVALID_VALUE"}
|
|
38
40
|
]
|