Skip to content

Commit 1d2c0f7

Browse files
authored
Add a TPC-H PPL query suite (opensearch-project#3622)
* Add a TPC-H PPL query suite Signed-off-by: Lantao Jin <ltjin@amazon.com> * enable q4 and q21 Signed-off-by: Lantao Jin <ltjin@amazon.com> --------- Signed-off-by: Lantao Jin <ltjin@amazon.com>
1 parent e6116bc commit 1d2c0f7

41 files changed

Lines changed: 19187 additions & 1 deletion

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/tpch/CalcitePPLTpchIT.java

Lines changed: 499 additions & 0 deletions
Large diffs are not rendered by default.

integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import static org.opensearch.sql.legacy.TestUtils.getResponseBody;
4040
import static org.opensearch.sql.legacy.TestUtils.getStateCountryIndexMapping;
4141
import static org.opensearch.sql.legacy.TestUtils.getStringIndexMapping;
42+
import static org.opensearch.sql.legacy.TestUtils.getTpchMappingFile;
4243
import static org.opensearch.sql.legacy.TestUtils.getUnexpandedObjectIndexMapping;
4344
import static org.opensearch.sql.legacy.TestUtils.getWeblogsIndexMapping;
4445
import static org.opensearch.sql.legacy.TestUtils.getWorkInformationIndexMapping;
@@ -847,7 +848,47 @@ public enum Index {
847848
TestsConstants.TEST_INDEX_DUPLICATION_NULLABLE,
848849
"duplication_nullable",
849850
getDuplicationNullableIndexMapping(),
850-
"src/test/resources/duplication_nullable.json");
851+
"src/test/resources/duplication_nullable.json"),
852+
TPCH_ORDERS(
853+
"orders",
854+
"tpch",
855+
getTpchMappingFile("orders_index_mapping.json"),
856+
"src/test/resources/tpch/data/orders.json"),
857+
TPCH_NATION(
858+
"nation",
859+
"tpch",
860+
getTpchMappingFile("nation_index_mapping.json"),
861+
"src/test/resources/tpch/data/nation.json"),
862+
TPCH_REGION(
863+
"region",
864+
"tpch",
865+
getTpchMappingFile("region_index_mapping.json"),
866+
"src/test/resources/tpch/data/region.json"),
867+
TPCH_LINEITEM(
868+
"lineitem",
869+
"tpch",
870+
getTpchMappingFile("lineitem_index_mapping.json"),
871+
"src/test/resources/tpch/data/lineitem.json"),
872+
TPCH_PARTSUPP(
873+
"partsupp",
874+
"tpch",
875+
getTpchMappingFile("partsupp_index_mapping.json"),
876+
"src/test/resources/tpch/data/partsupp.json"),
877+
TPCH_SUPPLIER(
878+
"supplier",
879+
"tpch",
880+
getTpchMappingFile("supplier_index_mapping.json"),
881+
"src/test/resources/tpch/data/supplier.json"),
882+
TPCH_PART(
883+
"part",
884+
"tpch",
885+
getTpchMappingFile("part_index_mapping.json"),
886+
"src/test/resources/tpch/data/part.json"),
887+
TPCH_CUSTOMER(
888+
"customer",
889+
"tpch",
890+
getTpchMappingFile("customer_index_mapping.json"),
891+
"src/test/resources/tpch/data/customer.json");
851892

852893
private final String name;
853894
private final String type;

integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,4 +459,12 @@ public static String getMappingFile(String fileName) {
459459
return null;
460460
}
461461
}
462+
463+
public static String getTpchMappingFile(String fileName) {
464+
try {
465+
return TestUtils.fileToString("src/test/resources/tpch/mappings/" + fileName, false);
466+
} catch (IOException e) {
467+
return null;
468+
}
469+
}
462470
}

integ-test/src/test/resources/tpch/data/customer.json

Lines changed: 300 additions & 0 deletions
Large diffs are not rendered by default.

integ-test/src/test/resources/tpch/data/lineitem.json

Lines changed: 12010 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{"index": {}}
2+
{"n_nationkey":0,"n_name":"ALGERIA","n_regionkey":0,"n_comment":" haggle. carefully final deposits detect slyly agai"}
3+
{"index": {}}
4+
{"n_nationkey":1,"n_name":"ARGENTINA","n_regionkey":1,"n_comment":"al foxes promise slyly according to the regular accounts. bold requests alon"}
5+
{"index": {}}
6+
{"n_nationkey":2,"n_name":"BRAZIL","n_regionkey":1,"n_comment":"y alongside of the pending deposits. carefully special packages are about the ironic forges. slyly special "}
7+
{"index": {}}
8+
{"n_nationkey":3,"n_name":"CANADA","n_regionkey":1,"n_comment":"eas hang ironic, silent packages. slyly regular packages are furiously over the tithes. fluffily bold"}
9+
{"index": {}}
10+
{"n_nationkey":4,"n_name":"EGYPT","n_regionkey":4,"n_comment":"y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d"}
11+
{"index": {}}
12+
{"n_nationkey":5,"n_name":"ETHIOPIA","n_regionkey":0,"n_comment":"ven packages wake quickly. regu"}
13+
{"index": {}}
14+
{"n_nationkey":6,"n_name":"FRANCE","n_regionkey":3,"n_comment":"refully final requests. regular, ironi"}
15+
{"index": {}}
16+
{"n_nationkey":7,"n_name":"GERMANY","n_regionkey":3,"n_comment":"l platelets. regular accounts x-ray: unusual, regular acco"}
17+
{"index": {}}
18+
{"n_nationkey":8,"n_name":"INDIA","n_regionkey":2,"n_comment":"ss excuses cajole slyly across the packages. deposits print aroun"}
19+
{"index": {}}
20+
{"n_nationkey":9,"n_name":"INDONESIA","n_regionkey":2,"n_comment":" slyly express asymptotes. regular deposits haggle slyly. carefully ironic hockey players sleep blithely. carefull"}
21+
{"index": {}}
22+
{"n_nationkey":10,"n_name":"IRAN","n_regionkey":4,"n_comment":"efully alongside of the slyly final dependencies. "}
23+
{"index": {}}
24+
{"n_nationkey":11,"n_name":"IRAQ","n_regionkey":4,"n_comment":"nic deposits boost atop the quickly final requests? quickly regula"}
25+
{"index": {}}
26+
{"n_nationkey":12,"n_name":"JAPAN","n_regionkey":2,"n_comment":"ously. final, express gifts cajole a"}
27+
{"index": {}}
28+
{"n_nationkey":13,"n_name":"JORDAN","n_regionkey":4,"n_comment":"ic deposits are blithely about the carefully regular pa"}
29+
{"index": {}}
30+
{"n_nationkey":14,"n_name":"KENYA","n_regionkey":0,"n_comment":" pending excuses haggle furiously deposits. pending, express pinto beans wake fluffily past t"}
31+
{"index": {}}
32+
{"n_nationkey":15,"n_name":"MOROCCO","n_regionkey":0,"n_comment":"rns. blithely bold courts among the closely regular packages use furiously bold platelets?"}
33+
{"index": {}}
34+
{"n_nationkey":16,"n_name":"MOZAMBIQUE","n_regionkey":0,"n_comment":"s. ironic, unusual asymptotes wake blithely r"}
35+
{"index": {}}
36+
{"n_nationkey":17,"n_name":"PERU","n_regionkey":1,"n_comment":"platelets. blithely pending dependencies use fluffily across the even pinto beans. carefully silent accoun"}
37+
{"index": {}}
38+
{"n_nationkey":18,"n_name":"CHINA","n_regionkey":2,"n_comment":"c dependencies. furiously express notornis sleep slyly regular accounts. ideas sleep. depos"}
39+
{"index": {}}
40+
{"n_nationkey":19,"n_name":"ROMANIA","n_regionkey":3,"n_comment":"ular asymptotes are about the furious multipliers. express dependencies nag above the ironically ironic account"}
41+
{"index": {}}
42+
{"n_nationkey":20,"n_name":"SAUDI ARABIA","n_regionkey":4,"n_comment":"ts. silent requests haggle. closely express packages sleep across the blithely"}
43+
{"index": {}}
44+
{"n_nationkey":21,"n_name":"VIETNAM","n_regionkey":2,"n_comment":"hely enticingly express accounts. even, final "}
45+
{"index": {}}
46+
{"n_nationkey":22,"n_name":"RUSSIA","n_regionkey":3,"n_comment":" requests against the platelets use never according to the quickly regular pint"}
47+
{"index": {}}
48+
{"n_nationkey":23,"n_name":"UNITED KINGDOM","n_regionkey":3,"n_comment":"eans boost carefully special requests. accounts are. carefull"}
49+
{"index": {}}
50+
{"n_nationkey":24,"n_name":"UNITED STATES","n_regionkey":1,"n_comment":"y final packages. slow foxes cajole quickly. quickly silent platelets breach ironic accounts. unusual pinto be"}

0 commit comments

Comments
 (0)