Skip to content

Commit 96ef82c

Browse files
committed
Merge remote-tracking branch 'apache/master' into newCodeGen
Conflicts: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
2 parents f34122d + 86534d0 commit 96ef82c

File tree

5 files changed

+144
-3
lines changed

5 files changed

+144
-3
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class Analyzer(catalog: Catalog, registry: FunctionRegistry, caseSensitive: Bool
159159
object UnresolvedHavingClauseAttributes extends Rule[LogicalPlan] {
160160
def apply(plan: LogicalPlan): LogicalPlan = plan transformUp {
161161
case filter @ Filter(havingCondition, aggregate @ Aggregate(_, originalAggExprs, _))
162-
if !filter.resolved && aggregate.resolved && containsAggregate(havingCondition) => {
162+
if aggregate.resolved && containsAggregate(havingCondition) => {
163163
val evaluatedCondition = Alias(havingCondition, "havingCondition")()
164164
val aggExprsWithHaving = evaluatedCondition +: originalAggExprs
165165

sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import java.util.Properties
2222
import scala.collection.JavaConverters._
2323

2424
object SQLConf {
25+
val COMPRESS_CACHED = "spark.sql.inMemoryColumnarStorage.compressed"
2526
val AUTO_BROADCASTJOIN_THRESHOLD = "spark.sql.autoBroadcastJoinThreshold"
2627
val DEFAULT_SIZE_IN_BYTES = "spark.sql.defaultSizeInBytes"
2728
val AUTO_CONVERT_JOIN_SIZE = "spark.sql.auto.convert.join.size"
@@ -52,6 +53,9 @@ trait SQLConf {
5253
/** ************************ Spark SQL Params/Hints ******************* */
5354
// TODO: refactor so that these hints accessors don't pollute the name space of SQLContext?
5455

56+
/** When true tables cached using the in-memory columnar caching will be compressed. */
57+
private[spark] def useCompression: Boolean = get(COMPRESS_CACHED, "false").toBoolean
58+
5559
/** Number of partitions to use for shuffle operators. */
5660
private[spark] def numShufflePartitions: Int = get(SHUFFLE_PARTITIONS, "200").toInt
5761

sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ class SQLContext(@transient val sparkContext: SparkContext)
193193
currentTable.logicalPlan
194194

195195
case _ =>
196-
val useCompression =
197-
sparkContext.conf.getBoolean("spark.sql.inMemoryColumnarStorage.compressed", false)
198196
InMemoryRelation(useCompression, executePlan(currentTable).executedPlan)
199197
}
200198

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
0
2+
5
3+
12
4+
15
5+
18
6+
24
7+
26
8+
35
9+
37
10+
42
11+
51
12+
58
13+
67
14+
70
15+
72
16+
76
17+
83
18+
84
19+
90
20+
95
21+
97
22+
98
23+
100
24+
103
25+
104
26+
113
27+
118
28+
119
29+
120
30+
125
31+
128
32+
129
33+
134
34+
137
35+
138
36+
146
37+
149
38+
152
39+
164
40+
165
41+
167
42+
169
43+
172
44+
174
45+
175
46+
176
47+
179
48+
187
49+
191
50+
193
51+
195
52+
197
53+
199
54+
200
55+
203
56+
205
57+
207
58+
208
59+
209
60+
213
61+
216
62+
217
63+
219
64+
221
65+
223
66+
224
67+
229
68+
230
69+
233
70+
237
71+
238
72+
239
73+
242
74+
255
75+
256
76+
265
77+
272
78+
273
79+
277
80+
278
81+
280
82+
281
83+
282
84+
288
85+
298
86+
307
87+
309
88+
311
89+
316
90+
317
91+
318
92+
321
93+
322
94+
325
95+
327
96+
331
97+
333
98+
342
99+
344
100+
348
101+
353
102+
367
103+
369
104+
382
105+
384
106+
395
107+
396
108+
397
109+
399
110+
401
111+
403
112+
404
113+
406
114+
409
115+
413
116+
414
117+
417
118+
424
119+
429
120+
430
121+
431
122+
438
123+
439
124+
454
125+
458
126+
459
127+
462
128+
463
129+
466
130+
468
131+
469
132+
478
133+
480
134+
489
135+
492
136+
498

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class HiveQuerySuite extends HiveComparisonTest {
4141
createQueryTest("case else null",
4242
"""SELECT case when 1 = 2 then 1 when 2 = 2 then 3 else null end FROM src LIMIT 1""")
4343

44+
createQueryTest("having no references",
45+
"SELECT key FROM src GROUP BY key HAVING COUNT(*) > 1")
46+
4447
createQueryTest("boolean = number",
4548
"""
4649
|SELECT

0 commit comments

Comments
 (0)