@@ -46,7 +46,8 @@ object GetField {
46
46
MapOrdinalGetField (child, fieldExpr)
47
47
case (otherType, _) =>
48
48
throw new AnalysisException (
49
- s " GetField is not valid on child of type $otherType with fieldExpr of type ${fieldExpr.dataType}" )
49
+ " GetField is not valid on child of type " +
50
+ s " $otherType with fieldExpr of type ${fieldExpr.dataType}" )
50
51
}
51
52
}
52
53
@@ -138,8 +139,11 @@ case class SimpleStructGetField(child: Expression, field: StructField, ordinal:
138
139
/**
139
140
* Returns the array of value of fields in the Array of Struct `child`.
140
141
*/
141
- case class ArrayStructGetField (child : Expression , field : StructField , ordinal : Int , containsNull : Boolean )
142
- extends StructGetField {
142
+ case class ArrayStructGetField (
143
+ child : Expression ,
144
+ field : StructField ,
145
+ ordinal : Int ,
146
+ containsNull : Boolean ) extends StructGetField {
143
147
144
148
override def dataType : DataType = ArrayType (field.dataType, containsNull)
145
149
override def nullable : Boolean = child.nullable
@@ -160,7 +164,7 @@ case class ArrayStructGetField(child: Expression, field: StructField, ordinal: I
160
164
case class ArrayOrdinalGetField (child : Expression , ordinal : Expression )
161
165
extends OrdinalGetField {
162
166
163
- override def dataType = child.dataType.asInstanceOf [ArrayType ].elementType
167
+ override def dataType : DataType = child.dataType.asInstanceOf [ArrayType ].elementType
164
168
165
169
override lazy val resolved = childrenResolved &&
166
170
child.dataType.isInstanceOf [ArrayType ] && ordinal.dataType.isInstanceOf [IntegralType ]
@@ -184,12 +188,12 @@ case class ArrayOrdinalGetField(child: Expression, ordinal: Expression)
184
188
case class MapOrdinalGetField (child : Expression , ordinal : Expression )
185
189
extends OrdinalGetField {
186
190
187
- override def dataType = child.dataType.asInstanceOf [MapType ].valueType
191
+ override def dataType : DataType = child.dataType.asInstanceOf [MapType ].valueType
188
192
189
193
override lazy val resolved = childrenResolved && child.dataType.isInstanceOf [MapType ]
190
194
191
195
protected def evalNotNull (value : Any , ordinal : Any ) = {
192
196
val baseValue = value.asInstanceOf [Map [Any , _]]
193
197
baseValue.get(ordinal).orNull
194
198
}
195
- }
199
+ }
0 commit comments