1[
2    {
3        "testcase": "Unnest --> Hash Join, build outer (unnest on build side). Explain",
4        "ignore": "index_id",
5        "explain": {
6            "disabled": false,
7            "results": [
8                {
9                    "present": true
10                }
11            ],
12            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'HashJoin' END"
13        },
14        "statements":"SELECT pc.purchaseId, l.product, pd.name FROM purchase pc UNNEST pc.lineItems as l JOIN product pd USE HASH(probe) ON l.product = pd.productId WHERE pc.purchaseId = \"purchase6558\" ORDER BY l.product",
15        "ordered": true,
16        "results": [
17        {
18            "name": "Brother CP-6500 Computerized Sewing Machine",
19            "product": "product218",
20            "purchaseId": "purchase6558"
21        },
22        {
23            "name": "Hunter 26406 Architect Series Plus 52-Inch 5-Blade3-Light Ceiling Fan, Brushed Nickel with Chestnut/Maple Blades and Frosted Scalloped Glass Shades",
24            "product": "product376",
25            "purchaseId": "purchase6558"
26        },
27        {
28            "name": "Boon Glo Nightlight with Portable Balls, White",
29            "product": "product387",
30            "purchaseId": "purchase6558"
31        },
32        {
33            "name": "Diamondback 2013 Cobra Junior Mountain Bike with 24-Inch Wheels  (Red, 24-Inch/Boys)",
34            "product": "product794",
35            "purchaseId": "purchase6558"
36        }
37    ]
38    },
39    {
40        "testcase": "NL Join --> Unnest --> Hash Join, build outer (NL Join and Unnest on build side). Explain",
41        "ignore": "index_id",
42        "explain": {
43            "disabled": false,
44            "results": [
45                {
46                    "present": true
47                }
48            ],
49            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'HashJoin' AND ARRAY_LENGTH(v.`build_aliases`) = 3 AND ANY v2 WITHIN v.`~child`.`~children` SATISFIES v2.`#operator` = 'NestedLoopJoin' END END"
50        },
51        "statements":"SELECT pc.purchaseId, l.product, pd.name, c.lastName, c.firstName FROM purchase pc JOIN customer c ON pc.customerId = c.customerId UNNEST pc.lineItems as l JOIN product pd USE HASH(probe) ON l.product = pd.productId WHERE pc.purchaseId = \"purchase6558\" ORDER BY l.product",
52        "ordered": true,
53        "results": [
54        {
55            "firstName": "Ruthe",
56            "lastName": "Rodriguez",
57            "name": "Brother CP-6500 Computerized Sewing Machine",
58            "product": "product218",
59            "purchaseId": "purchase6558"
60        },
61        {
62            "firstName": "Ruthe",
63            "lastName": "Rodriguez",
64            "name": "Hunter 26406 Architect Series Plus 52-Inch 5-Blade3-Light Ceiling Fan, Brushed Nickel with Chestnut/Maple Blades and Frosted Scalloped Glass Shades",
65            "product": "product376",
66            "purchaseId": "purchase6558"
67        },
68        {
69            "firstName": "Ruthe",
70            "lastName": "Rodriguez",
71            "name": "Boon Glo Nightlight with Portable Balls, White",
72            "product": "product387",
73            "purchaseId": "purchase6558"
74        },
75        {
76            "firstName": "Ruthe",
77            "lastName": "Rodriguez",
78            "name": "Diamondback 2013 Cobra Junior Mountain Bike with 24-Inch Wheels  (Red, 24-Inch/Boys)",
79            "product": "product794",
80            "purchaseId": "purchase6558"
81        }
82    ]
83    },
84    {
85        "testcase": "Hash Join --> Unnest --> NL Join, build inner. Explain",
86        "ignore": "index_id",
87        "explain": {
88            "disabled": false,
89            "results": [
90                {
91                    "present": true
92                }
93            ],
94            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'HashJoin' END AND ANY v2 WITHIN p.plan.`~children` SATISFIES v2.`#operator` = 'NestedLoopJoin' END"
95        },
96        "statements":"SELECT pc.purchaseId, l.product, pd.name, c.lastName, c.firstName FROM purchase pc JOIN customer c USE HASH(build) ON pc.customerId = c.customerId UNNEST pc.lineItems as l JOIN product pd ON l.product = pd.productId WHERE pc.purchaseId = \"purchase6558\" ORDER BY l.product",
97        "ordered": true,
98        "results": [
99        {
100            "firstName": "Ruthe",
101            "lastName": "Rodriguez",
102            "name": "Brother CP-6500 Computerized Sewing Machine",
103            "product": "product218",
104            "purchaseId": "purchase6558"
105        },
106        {
107            "firstName": "Ruthe",
108            "lastName": "Rodriguez",
109            "name": "Hunter 26406 Architect Series Plus 52-Inch 5-Blade3-Light Ceiling Fan, Brushed Nickel with Chestnut/Maple Blades and Frosted Scalloped Glass Shades",
110            "product": "product376",
111            "purchaseId": "purchase6558"
112        },
113        {
114            "firstName": "Ruthe",
115            "lastName": "Rodriguez",
116            "name": "Boon Glo Nightlight with Portable Balls, White",
117            "product": "product387",
118            "purchaseId": "purchase6558"
119        },
120        {
121            "firstName": "Ruthe",
122            "lastName": "Rodriguez",
123            "name": "Diamondback 2013 Cobra Junior Mountain Bike with 24-Inch Wheels  (Red, 24-Inch/Boys)",
124            "product": "product794",
125            "purchaseId": "purchase6558"
126        }
127    ]
128    },
129    {
130        "testcase": "Hash Join --> Unnest --> Hash Join, first build outer, second build inner. Explain",
131        "ignore": "index_id",
132        "explain": {
133            "disabled": false,
134            "results": [
135                {
136                    "present": true
137                }
138            ],
139            "statement": "SELECT true AS present FROM $explan AS p WHERE ANY v WITHIN p.plan.`~children` SATISFIES v.`#operator` = 'HashJoin' AND v.`build_aliases`[0] = 'pd' END AND ANY v2 WITHIN p.plan.`~children` SATISFIES v2.`#operator` = 'HashJoin' AND v2.`build_aliases`[0] = 'pc' END"
140        },
141        "statements":"SELECT pc.purchaseId, l.product, pd.name, c.lastName, c.firstName FROM purchase pc JOIN customer c USE HASH(probe) ON pc.customerId = c.customerId UNNEST pc.lineItems as l JOIN product pd USE HASH(build) ON l.product = pd.productId WHERE pc.purchaseId = \"purchase6558\" ORDER BY l.product",
142        "ordered": true,
143        "results": [
144        {
145            "firstName": "Ruthe",
146            "lastName": "Rodriguez",
147            "name": "Brother CP-6500 Computerized Sewing Machine",
148            "product": "product218",
149            "purchaseId": "purchase6558"
150        },
151        {
152            "firstName": "Ruthe",
153            "lastName": "Rodriguez",
154            "name": "Hunter 26406 Architect Series Plus 52-Inch 5-Blade3-Light Ceiling Fan, Brushed Nickel with Chestnut/Maple Blades and Frosted Scalloped Glass Shades",
155            "product": "product376",
156            "purchaseId": "purchase6558"
157        },
158        {
159            "firstName": "Ruthe",
160            "lastName": "Rodriguez",
161            "name": "Boon Glo Nightlight with Portable Balls, White",
162            "product": "product387",
163            "purchaseId": "purchase6558"
164        },
165        {
166            "firstName": "Ruthe",
167            "lastName": "Rodriguez",
168            "name": "Diamondback 2013 Cobra Junior Mountain Bike with 24-Inch Wheels  (Red, 24-Inch/Boys)",
169            "product": "product794",
170            "purchaseId": "purchase6558"
171        }
172    ]
173    }
174]
175
176