17
17
18
18
package org .apache .carbondata .mv .plans .modular
19
19
20
- import org .apache .spark .sql .{CarbonToSparkAdapter , SQLConf }
21
20
import org .apache .spark .sql .catalyst .expressions ._
22
21
import org .apache .spark .sql .catalyst .plans ._
23
22
import org .apache .spark .sql .catalyst .rules ._
24
- import org .apache .spark .sql .types . Metadata
23
+ import org .apache .spark .sql .SQLConf
25
24
26
25
import org .apache .carbondata .mv .plans
27
26
import org .apache .carbondata .mv .plans ._
@@ -199,28 +198,28 @@ object HarmonizeFactTable extends Rule[ModularPlan] with PredicateHelper with Ag
199
198
.isInstanceOf [Attribute ]))
200
199
val aggOutputList = aggTransMap.values.flatMap(t => t._2)
201
200
.map { ref =>
202
- CarbonToSparkAdapter .createAttributeReference (
203
- ref.name, ref.dataType, nullable = true , Metadata .empty ,
204
- ref.exprId, Some (hFactName))
201
+ AttributeReference (ref.name, ref.dataType) (
202
+ exprId = ref.exprId ,
203
+ qualifier = Some (hFactName))
205
204
}
206
205
val hFactOutputSet = hFact.outputSet
207
206
// Update the outputlist qualifier
208
207
val hOutputList = (attrOutputList ++ aggOutputList).map {attr =>
209
208
attr.transform {
210
209
case ref : Attribute if hFactOutputSet.contains(ref) =>
211
- CarbonToSparkAdapter .createAttributeReference (
212
- ref.name, ref.dataType, nullable = true , Metadata .empty ,
213
- ref.exprId, Some (hFactName))
210
+ AttributeReference (ref.name, ref.dataType) (
211
+ exprId = ref.exprId ,
212
+ qualifier = Some (hFactName))
214
213
}
215
214
}.asInstanceOf [Seq [NamedExpression ]]
216
215
217
216
// Update the predicate qualifier
218
217
val hPredList = s.predicateList.map{ pred =>
219
218
pred.transform {
220
219
case ref : Attribute if hFactOutputSet.contains(ref) =>
221
- CarbonToSparkAdapter .createAttributeReference (
222
- ref.name, ref.dataType, nullable = true , Metadata .empty ,
223
- ref.exprId, Some (hFactName))
220
+ AttributeReference (ref.name, ref.dataType) (
221
+ exprId = ref.exprId ,
222
+ qualifier = Some (hFactName))
224
223
}
225
224
}
226
225
val hSel = s.copy(
@@ -242,9 +241,9 @@ object HarmonizeFactTable extends Rule[ModularPlan] with PredicateHelper with Ag
242
241
val wip = g.copy(outputList = gOutputList, inputList = hInputList, child = hSel)
243
242
wip.transformExpressions {
244
243
case ref : Attribute if hFactOutputSet.contains(ref) =>
245
- CarbonToSparkAdapter .createAttributeReference (
246
- ref.name, ref.dataType, nullable = true , Metadata .empty ,
247
- ref.exprId, Some (hFactName))
244
+ AttributeReference (ref.name, ref.dataType) (
245
+ exprId = ref.exprId ,
246
+ qualifier = Some (hFactName))
248
247
}
249
248
}
250
249
}
0 commit comments