Skip to content

Commit 8ee8b09

Browse files
committed
Add original SQL and fix the bug of Sarg point (q41)
Signed-off-by: Lantao Jin <ltjin@amazon.com>
1 parent 0f1912b commit 8ee8b09

47 files changed

Lines changed: 206 additions & 38 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

integ-test/src/test/java/org/opensearch/sql/calcite/clickbench/CalcitePPLClickBenchIT.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package org.opensearch.sql.calcite.clickbench;
77

8-
import java.util.Set;
98
import org.junit.FixMethodOrder;
109
import org.junit.runners.MethodSorters;
1110

@@ -18,9 +17,4 @@ public void init() throws Exception {
1817
enableCalcite();
1918
disallowCalciteFallback();
2019
}
21-
22-
@Override
23-
protected Set<Integer> ignored() {
24-
return Set.of(29, 41, 43);
25-
}
2620
}

integ-test/src/test/java/org/opensearch/sql/calcite/clickbench/PPLClickBenchIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ public static void reset() throws IOException {
4848
System.out.println();
4949
}
5050

51+
/** Ignore queries that are not supported by Calcite. */
5152
protected Set<Integer> ignored() {
52-
return Set.of(29, 43);
53+
return Set.of(29);
5354
}
5455

5556
@Test
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
{"index":{}}
2-
{"WatchID":"9110818468285196899","JavaEnable":0,"Title":"","GoodEvent":1,"EventTime":"2013-07-14 20:38:47","EventDate":"2013-07-15","CounterID":17,"ClientIP":-1216690514,"RegionID":839,"UserID":"-2461439046089301801","CounterClass":0,"OS":0,"UserAgent":0,"URL":"","Referer":"","IsRefresh":0,"RefererCategoryID":0,"RefererRegionID":0,"URLCategoryID":0,"URLRegionID":0,"ResolutionWidth":0,"ResolutionHeight":0,"ResolutionDepth":0,"FlashMajor":0,"FlashMinor":0,"FlashMinor2":"","NetMajor":0,"NetMinor":0,"UserAgentMajor":0,"UserAgentMinor":"�O","CookieEnable":0,"JavascriptEnable":0,"IsMobile":0,"MobilePhone":0,"MobilePhoneModel":"","Params":"","IPNetworkID":3793327,"TraficSourceID":4,"SearchEngineID":0,"SearchPhrase":"","AdvEngineID":0,"IsArtifical":0,"WindowClientWidth":0,"WindowClientHeight":0,"ClientTimeZone":-1,"ClientEventTime":"1971-01-01 14:16:06","SilverlightVersion1":0,"SilverlightVersion2":0,"SilverlightVersion3":0,"SilverlightVersion4":0,"PageCharset":"","CodeVersion":0,"IsLink":0,"IsDownload":0,"IsNotBounce":0,"FUniqID":"0","OriginalURL":"","HID":0,"IsOldCounter":0,"IsEvent":0,"IsParameter":0,"DontCountHits":0,"WithHash":0,"HitColor":"5","LocalEventTime":"2013-07-15 10:47:34","Age":0,"Sex":0,"Income":0,"Interests":0,"Robotness":0,"RemoteIP":-1001831330,"WindowName":-1,"OpenerName":-1,"HistoryLength":-1,"BrowserLanguage":"�","BrowserCountry":"�\f","SocialNetwork":"","SocialAction":"","HTTPError":0,"SendTiming":0,"DNSTiming":0,"ConnectTiming":0,"ResponseStartTiming":0,"ResponseEndTiming":0,"FetchTiming":0,"SocialSourceNetworkID":0,"SocialSourcePage":"","ParamPrice":"0","ParamOrderID":"","ParamCurrency":"NH\u001C","ParamCurrencyID":0,"OpenstatServiceName":"","OpenstatCampaignID":"","OpenstatAdID":"","OpenstatSourceID":"","UTMSource":"","UTMMedium":"","UTMCampaign":"","UTMContent":"","UTMTerm":"","FromTag":"","HasGCLID":0,"RefererHash":"-296158784638538920","URLHash":"-8417682003818480435","CLID":0}
2+
{"WatchID":"9110818468285196899","JavaEnable":0,"Title":"","GoodEvent":1,"EventTime":"2013-07-14 20:38:47","EventDate":"2013-07-15","CounterID":17,"ClientIP":-1216690514,"RegionID":839,"UserID":"-2461439046089301801","CounterClass":0,"OS":0,"UserAgent":0,"URL":"","Referer":"https://example.org/about","IsRefresh":0,"RefererCategoryID":0,"RefererRegionID":0,"URLCategoryID":0,"URLRegionID":0,"ResolutionWidth":0,"ResolutionHeight":0,"ResolutionDepth":0,"FlashMajor":0,"FlashMinor":0,"FlashMinor2":"","NetMajor":0,"NetMinor":0,"UserAgentMajor":0,"UserAgentMinor":"�O","CookieEnable":0,"JavascriptEnable":0,"IsMobile":0,"MobilePhone":0,"MobilePhoneModel":"","Params":"","IPNetworkID":3793327,"TraficSourceID":4,"SearchEngineID":0,"SearchPhrase":"","AdvEngineID":0,"IsArtifical":0,"WindowClientWidth":0,"WindowClientHeight":0,"ClientTimeZone":-1,"ClientEventTime":"1971-01-01 14:16:06","SilverlightVersion1":0,"SilverlightVersion2":0,"SilverlightVersion3":0,"SilverlightVersion4":0,"PageCharset":"","CodeVersion":0,"IsLink":0,"IsDownload":0,"IsNotBounce":0,"FUniqID":"0","OriginalURL":"","HID":0,"IsOldCounter":0,"IsEvent":0,"IsParameter":0,"DontCountHits":0,"WithHash":0,"HitColor":"5","LocalEventTime":"2013-07-15 10:47:34","Age":0,"Sex":0,"Income":0,"Interests":0,"Robotness":0,"RemoteIP":-1001831330,"WindowName":-1,"OpenerName":-1,"HistoryLength":-1,"BrowserLanguage":"�","BrowserCountry":"�\f","SocialNetwork":"","SocialAction":"","HTTPError":0,"SendTiming":0,"DNSTiming":0,"ConnectTiming":0,"ResponseStartTiming":0,"ResponseEndTiming":0,"FetchTiming":0,"SocialSourceNetworkID":0,"SocialSourcePage":"","ParamPrice":"0","ParamOrderID":"","ParamCurrency":"NH\u001C","ParamCurrencyID":0,"OpenstatServiceName":"","OpenstatCampaignID":"","OpenstatAdID":"","OpenstatSourceID":"","UTMSource":"","UTMMedium":"","UTMCampaign":"","UTMContent":"","UTMTerm":"","FromTag":"","HasGCLID":0,"RefererHash":"-296158784638538920","URLHash":"-8417682003818480435","CLID":0}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
/*
2+
SELECT COUNT(*) FROM hits;
3+
*/
14
source=hits | stats count()

integ-test/src/test/resources/clickbench/queries/q10.ppl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
SELECT RegionID, SUM(AdvEngineID), COUNT(*) AS c, AVG(ResolutionWidth), COUNT(DISTINCT UserID)
3+
FROM hits GROUP BY RegionID ORDER BY c DESC LIMIT 10;
4+
*/
15
source=hits
26
| stats sum(AdvEngineID), count() as c, avg(ResolutionWidth), dc(UserID) by RegionID
37
| sort - c

integ-test/src/test/resources/clickbench/queries/q11.ppl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
SELECT MobilePhoneModel, COUNT(DISTINCT UserID) AS u
3+
FROM hits WHERE MobilePhoneModel <> ''
4+
GROUP BY MobilePhoneModel ORDER BY u DESC LIMIT 10;
5+
*/
16
source=hits
27
| where MobilePhoneModel != ''
38
| stats dc(UserID) as u by MobilePhoneModel

integ-test/src/test/resources/clickbench/queries/q12.ppl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
SELECT MobilePhone, MobilePhoneModel, COUNT(DISTINCT UserID) AS u
3+
FROM hits WHERE MobilePhoneModel <> ''
4+
GROUP BY MobilePhone, MobilePhoneModel ORDER BY u DESC LIMIT 10;
5+
*/
16
source=hits
27
| where MobilePhoneModel != ''
38
| stats dc(UserID) as u by MobilePhone, MobilePhoneModel

integ-test/src/test/resources/clickbench/queries/q13.ppl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
SELECT SearchPhrase, COUNT(*) AS c FROM hits WHERE SearchPhrase <> ''
3+
GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10;
4+
*/
15
source=hits
26
| where SearchPhrase != ''
37
| stats count() as c by SearchPhrase

integ-test/src/test/resources/clickbench/queries/q14.ppl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
SELECT SearchPhrase, COUNT(DISTINCT UserID) AS u
3+
FROM hits WHERE SearchPhrase <> ''
4+
GROUP BY SearchPhrase ORDER BY u DESC LIMIT 10;
5+
*/
16
source=hits
27
| where SearchPhrase != ''
38
| stats dc(UserID) as u by SearchPhrase

integ-test/src/test/resources/clickbench/queries/q15.ppl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
SELECT SearchEngineID, SearchPhrase, COUNT(*) AS c
3+
FROM hits WHERE SearchPhrase <> ''
4+
GROUP BY SearchEngineID, SearchPhrase ORDER BY c DESC LIMIT 10;
5+
*/
16
source=hits
27
| where SearchPhrase != ''
38
| stats count() as c by SearchEngineID, SearchPhrase

0 commit comments

Comments
 (0)