Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class Analyzer(catalog: Catalog, registry: FunctionRegistry, caseSensitive: Bool
object UnresolvedHavingClauseAttributes extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transformUp {
case filter @ Filter(havingCondition, aggregate @ Aggregate(_, originalAggExprs, _))
if !filter.resolved && aggregate.resolved && containsAggregate(havingCondition) => {
if aggregate.resolved && containsAggregate(havingCondition) => {
val evaluatedCondition = Alias(havingCondition, "havingCondition")()
val aggExprsWithHaving = evaluatedCondition +: originalAggExprs

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
0
5
12
15
18
24
26
35
37
42
51
58
67
70
72
76
83
84
90
95
97
98
100
103
104
113
118
119
120
125
128
129
134
137
138
146
149
152
164
165
167
169
172
174
175
176
179
187
191
193
195
197
199
200
203
205
207
208
209
213
216
217
219
221
223
224
229
230
233
237
238
239
242
255
256
265
272
273
277
278
280
281
282
288
298
307
309
311
316
317
318
321
322
325
327
331
333
342
344
348
353
367
369
382
384
395
396
397
399
401
403
404
406
409
413
414
417
424
429
430
431
438
439
454
458
459
462
463
466
468
469
478
480
489
492
498
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ case class TestData(a: Int, b: String)
*/
class HiveQuerySuite extends HiveComparisonTest {

createQueryTest("having no references",
"SELECT key FROM src GROUP BY key HAVING COUNT(*) > 1")

createQueryTest("boolean = number",
"""
|SELECT
Expand Down