2021-08-23 09:03:59 +00:00
|
|
|
<test>
|
|
|
|
<preconditions>
|
2021-08-25 07:26:48 +00:00
|
|
|
<table_exists>hits_10m_single</table_exists>
|
2021-08-27 08:14:17 +00:00
|
|
|
<table_exists>test.hits</table_exists>
|
2021-08-23 09:03:59 +00:00
|
|
|
</preconditions>
|
|
|
|
|
2021-08-27 08:14:17 +00:00
|
|
|
<!-- Queries with some matching rows -->
|
|
|
|
<query>
|
|
|
|
SELECT 1 FROM hits_10m_single GROUP BY EventTime HAVING
|
|
|
|
sequenceMatch('(?1)(?t<1)(?2)')(
|
|
|
|
EventTime, Age BETWEEN 20 AND 30, Age BETWEEN 35 AND 50)
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
<query>
|
|
|
|
SELECT 1 FROM test.hits GROUP BY EventTime HAVING
|
|
|
|
sequenceMatch('(?1)(?t<1)(?2)')(
|
|
|
|
EventTime, Age BETWEEN 20 AND 30, Age BETWEEN 35 AND 50)
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
<!-- Same queries as above, but with all rows matching the last condition -->
|
|
|
|
<query>
|
|
|
|
SELECT 1 FROM hits_10m_single GROUP BY EventTime HAVING
|
|
|
|
sequenceMatch('(?1)(?t<1)(?2)')(
|
|
|
|
EventTime, Age BETWEEN 20 AND 30, Age BETWEEN 35 AND 50, Age >= 0)
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
<query>
|
|
|
|
SELECT 1 FROM test.hits GROUP BY EventTime HAVING
|
|
|
|
sequenceMatch('(?1)(?t<1)(?2)')(
|
|
|
|
EventTime, Age BETWEEN 20 AND 30, Age BETWEEN 35 AND 50, Age >= 0)
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
<!-- Queries with no rows matching (Age is never negative) -->
|
2021-08-26 14:42:39 +00:00
|
|
|
<query>
|
|
|
|
SELECT 1 FROM hits_10m_single GROUP BY EventTime HAVING
|
|
|
|
sequenceMatch('(?1)(?t<1)(?2)')(
|
|
|
|
EventTime, Age >= 0, Age = -1)
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
2021-08-27 08:14:17 +00:00
|
|
|
<query>
|
|
|
|
SELECT 1 FROM test.hits GROUP BY EventTime HAVING
|
|
|
|
sequenceMatch('(?1)(?t<1)(?2)')(
|
|
|
|
EventTime, Age >= 0, Age = -1)
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
<!-- Using array conditions in further tests (only available for test.hits) for good diversity of matched rows percentage -->
|
2021-08-23 09:03:59 +00:00
|
|
|
|
2021-08-26 14:42:39 +00:00
|
|
|
<!-- Queries with time constraints -->
|
|
|
|
<query>
|
2021-08-27 08:14:17 +00:00
|
|
|
SELECT 1 FROM test.hits WHERE RefererCategories != [] GROUP BY ClientIP, RequestNum HAVING
|
2021-08-23 09:03:59 +00:00
|
|
|
sequenceMatch('(?1)(?t>1000)(?3)')(
|
2021-08-26 14:42:39 +00:00
|
|
|
EventTime, hasAny(RefererCategories, [9]), hasAny(RefererCategories, [3849, 2, 3, 4, 5, 6, 7]), hasAll(RefererCategories, [1, 9]), hasAny(RefererCategories, [1, 2326, 5496]))
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
<query>
|
2021-08-27 08:14:17 +00:00
|
|
|
SELECT 1 FROM test.hits WHERE RefererCategories != [] GROUP BY ClientIP, RequestNum HAVING
|
2021-08-23 09:03:59 +00:00
|
|
|
sequenceMatch('(?1)(?t<10000)(?2)')(
|
2021-08-26 14:42:39 +00:00
|
|
|
EventTime, hasAny(RefererCategories, [3849, 2, 3, 4, 5, 6, 7]), hasAny(RefererCategories, [1, 2]))
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
<!-- Queries without time constraints -->
|
|
|
|
<query>
|
2021-08-27 08:14:17 +00:00
|
|
|
SELECT 1 FROM test.hits WHERE RefererCategories != [] GROUP BY ClientIP, RequestNum HAVING
|
2021-08-23 09:03:59 +00:00
|
|
|
sequenceMatch('(?1)(?3)(?1)(?3)')(
|
2021-08-26 14:42:39 +00:00
|
|
|
EventTime, hasAny(RefererCategories, [9]), hasAny(RefererCategories, [3849, 2, 3, 4, 5, 6, 7]), hasAll(RefererCategories, [1, 9]), hasAny(RefererCategories, [1, 2326, 5496]))
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
<query>
|
2021-08-27 08:14:17 +00:00
|
|
|
SELECT 1 FROM test.hits WHERE RefererCategories != [] GROUP BY ClientIP, RequestNum HAVING
|
2021-08-23 09:03:59 +00:00
|
|
|
sequenceMatch('(?1)(?2)(?1)(?2)(?1)')(
|
2021-08-26 14:42:39 +00:00
|
|
|
EventTime, hasAny(RefererCategories, [3849, 2, 3, 4, 5, 6, 7]), hasAny(RefererCategories, [1, 2]))
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
2021-08-23 09:03:59 +00:00
|
|
|
|
2021-08-25 07:26:48 +00:00
|
|
|
</test>
|