Skip to content

Commit ea6f8a0

Browse files
TimelordUKclaude
andcommitted
test: Add formal test for SELECT * EXCLUDE feature
Adds expectations file for select_star_exclude example to enable formal validation in test suite. Changes: - Captured JSON expectations (289 lines, 16 query results) - Fixed example query to use 'Terrestrial' instead of 'Planet' for demo data - Test validates all EXCLUDE syntax variations: * Single column exclusion * Multiple column exclusion * With WHERE clause * With GROUP BY aggregation * Security/performance/readability use cases * Comparison with/without EXCLUDE Note: Manual capture used due to test framework bug with line-by-line JSON parsing (catches empty [] closing brackets before chunk parsing). Test can be run with: uv run python tests/integration/test_examples.py select_star_exclude Or as part of full suite: ./run_all_tests.sh 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a45b473 commit ea6f8a0

2 files changed

Lines changed: 291 additions & 1 deletion

File tree

Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
1+
[
2+
[
3+
{
4+
"demo": "=== Exclude Single Column ==="
5+
}
6+
],
7+
[
8+
{
9+
"albedo": 0.0,
10+
"atmosphere": "Hydrogen/Helium",
11+
"axial_tilt_deg": 7.25,
12+
"eccentricity": 0.0,
13+
"inclination_deg": 0.0,
14+
"mean_distance_au": 0.0,
15+
"name": "Sun",
16+
"position": 0
17+
},
18+
{
19+
"albedo": 0.142,
20+
"atmosphere": "None",
21+
"axial_tilt_deg": 0.034,
22+
"eccentricity": 0.2056,
23+
"inclination_deg": 7.0,
24+
"mean_distance_au": 0.387,
25+
"name": "Mercury",
26+
"position": 1
27+
},
28+
{
29+
"albedo": 0.689,
30+
"atmosphere": "CO2",
31+
"axial_tilt_deg": 177.4,
32+
"eccentricity": 0.0067,
33+
"inclination_deg": 3.4,
34+
"mean_distance_au": 0.723,
35+
"name": "Venus",
36+
"position": 2
37+
}
38+
],
39+
[
40+
{
41+
"demo": "=== Exclude Multiple Columns ==="
42+
}
43+
],
44+
[
45+
{
46+
"albedo": 0.306,
47+
"atmosphere": "N2/O2",
48+
"mean_distance_au": 1.0,
49+
"name": "Earth",
50+
"position": 3,
51+
"type": "Terrestrial"
52+
},
53+
{
54+
"albedo": 0.17,
55+
"atmosphere": "CO2",
56+
"mean_distance_au": 1.524,
57+
"name": "Mars",
58+
"position": 4,
59+
"type": "Terrestrial"
60+
},
61+
{
62+
"albedo": 0.343,
63+
"atmosphere": "H2/He",
64+
"mean_distance_au": 5.204,
65+
"name": "Jupiter",
66+
"position": 6,
67+
"type": "Gas Giant"
68+
}
69+
],
70+
[
71+
{
72+
"demo": "=== With Filtering ==="
73+
}
74+
],
75+
[
76+
{
77+
"albedo": 0.96,
78+
"atmosphere": "CH4",
79+
"axial_tilt_deg": 78.0,
80+
"mean_distance_au": 67.668,
81+
"name": "Eris",
82+
"position": 11,
83+
"type": "Dwarf Planet"
84+
},
85+
{
86+
"albedo": 0.72,
87+
"atmosphere": "N2/CH4/CO",
88+
"axial_tilt_deg": 122.5,
89+
"mean_distance_au": 39.482,
90+
"name": "Pluto",
91+
"position": 10,
92+
"type": "Dwarf Planet"
93+
},
94+
{
95+
"albedo": 0.29,
96+
"atmosphere": "H2/He/CH4",
97+
"axial_tilt_deg": 28.3,
98+
"mean_distance_au": 30.047,
99+
"name": "Neptune",
100+
"position": 9,
101+
"type": "Ice Giant"
102+
},
103+
{
104+
"albedo": 0.3,
105+
"atmosphere": "H2/He/CH4",
106+
"axial_tilt_deg": 97.8,
107+
"mean_distance_au": 19.201,
108+
"name": "Uranus",
109+
"position": 8,
110+
"type": "Ice Giant"
111+
},
112+
{
113+
"albedo": 0.342,
114+
"atmosphere": "H2/He",
115+
"axial_tilt_deg": 26.7,
116+
"mean_distance_au": 9.582,
117+
"name": "Saturn",
118+
"position": 7,
119+
"type": "Gas Giant"
120+
},
121+
{
122+
"albedo": 0.343,
123+
"atmosphere": "H2/He",
124+
"axial_tilt_deg": 3.1,
125+
"mean_distance_au": 5.204,
126+
"name": "Jupiter",
127+
"position": 6,
128+
"type": "Gas Giant"
129+
}
130+
],
131+
[
132+
{
133+
"demo": "=== With GROUP BY ==="
134+
}
135+
],
136+
[
137+
{
138+
"avg_distance": 0.0,
139+
"avg_tilt": 7.3,
140+
"count": 1,
141+
"type": "Star"
142+
},
143+
{
144+
"avg_distance": 0.91,
145+
"avg_tilt": 56.5,
146+
"count": 4,
147+
"type": "Terrestrial"
148+
},
149+
{
150+
"avg_distance": 1.0,
151+
"avg_tilt": 6.7,
152+
"count": 1,
153+
"type": "Moon"
154+
},
155+
{
156+
"avg_distance": 7.39,
157+
"avg_tilt": 14.9,
158+
"count": 2,
159+
"type": "Gas Giant"
160+
},
161+
{
162+
"avg_distance": 24.62,
163+
"avg_tilt": 63.1,
164+
"count": 2,
165+
"type": "Ice Giant"
166+
},
167+
{
168+
"avg_distance": 36.64,
169+
"avg_tilt": 68.2,
170+
"count": 3,
171+
"type": "Dwarf Planet"
172+
}
173+
],
174+
[
175+
{
176+
"demo": "=== Security: Hiding Sensitive Data ==="
177+
}
178+
],
179+
[
180+
{
181+
"atmosphere": "None",
182+
"eccentricity": 0.2056,
183+
"inclination_deg": 7.0,
184+
"mean_distance_au": 0.387,
185+
"name": "Mercury",
186+
"position": 1,
187+
"type": "Terrestrial"
188+
},
189+
{
190+
"atmosphere": "CO2",
191+
"eccentricity": 0.0067,
192+
"inclination_deg": 3.4,
193+
"mean_distance_au": 0.723,
194+
"name": "Venus",
195+
"position": 2,
196+
"type": "Terrestrial"
197+
},
198+
{
199+
"atmosphere": "N2/O2",
200+
"eccentricity": 0.0167,
201+
"inclination_deg": 0.0,
202+
"mean_distance_au": 1.0,
203+
"name": "Earth",
204+
"position": 3,
205+
"type": "Terrestrial"
206+
}
207+
],
208+
[
209+
{
210+
"demo": "=== Performance: Skip Large Columns ==="
211+
}
212+
],
213+
[
214+
{
215+
"albedo": 0.142,
216+
"axial_tilt_deg": 0.034,
217+
"eccentricity": 0.2056,
218+
"inclination_deg": 7.0,
219+
"mean_distance_au": 0.387,
220+
"name": "Mercury",
221+
"position": 1,
222+
"type": "Terrestrial"
223+
},
224+
{
225+
"albedo": 0.689,
226+
"axial_tilt_deg": 177.4,
227+
"eccentricity": 0.0067,
228+
"inclination_deg": 3.4,
229+
"mean_distance_au": 0.723,
230+
"name": "Venus",
231+
"position": 2,
232+
"type": "Terrestrial"
233+
},
234+
{
235+
"albedo": 0.306,
236+
"axial_tilt_deg": 23.4,
237+
"eccentricity": 0.0167,
238+
"inclination_deg": 0.0,
239+
"mean_distance_au": 1.0,
240+
"name": "Earth",
241+
"position": 3,
242+
"type": "Terrestrial"
243+
}
244+
],
245+
[
246+
{
247+
"demo": "=== Readability: Clean Output ==="
248+
}
249+
],
250+
[
251+
{
252+
"atmosphere": "CO2",
253+
"axial_tilt_deg": 177.4,
254+
"eccentricity": 0.0067,
255+
"inclination_deg": 3.4,
256+
"mean_distance_au": 0.723,
257+
"name": "Venus"
258+
},
259+
{
260+
"atmosphere": "N2/O2",
261+
"axial_tilt_deg": 23.4,
262+
"eccentricity": 0.0167,
263+
"inclination_deg": 0.0,
264+
"mean_distance_au": 1.0,
265+
"name": "Earth"
266+
},
267+
{
268+
"atmosphere": "None",
269+
"axial_tilt_deg": 6.7,
270+
"eccentricity": 0.0549,
271+
"inclination_deg": 5.1,
272+
"mean_distance_au": 1.0,
273+
"name": "Moon"
274+
},
275+
{
276+
"atmosphere": "CO2",
277+
"axial_tilt_deg": 25.2,
278+
"eccentricity": 0.0935,
279+
"inclination_deg": 1.9,
280+
"mean_distance_au": 1.524,
281+
"name": "Mars"
282+
}
283+
],
284+
[
285+
{
286+
"demo": "=== Without EXCLUDE (verbose) ==="
287+
}
288+
],
289+
[]
290+
]

examples/select_star_exclude.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ GO
7373
-- For demo purposes using solar_system:
7474
SELECT * EXCLUDE (axial_tilt_deg, albedo) -- Exclude less important columns
7575
FROM solar_system
76-
WHERE type = 'Planet'
76+
WHERE type = 'Terrestrial'
7777
LIMIT 3;
7878
GO
7979

0 commit comments

Comments
 (0)