@@ -219,34 +219,39 @@ trait Row extends Serializable {
219
219
* Returns the value at position i as a primitive boolean.
220
220
*
221
221
* @throws ClassCastException when data type does not match.
222
+ * @throws SparkException when value is null.
222
223
*/
223
224
def getBoolean (i : Int ): Boolean = getAnyValAs[Boolean ](i)
224
225
225
226
/**
226
227
* Returns the value at position i as a primitive byte.
227
228
*
228
229
* @throws ClassCastException when data type does not match.
230
+ * @throws SparkException when value is null.
229
231
*/
230
232
def getByte (i : Int ): Byte = getAnyValAs[Byte ](i)
231
233
232
234
/**
233
235
* Returns the value at position i as a primitive short.
234
236
*
235
237
* @throws ClassCastException when data type does not match.
238
+ * @throws SparkException when value is null.
236
239
*/
237
240
def getShort (i : Int ): Short = getAnyValAs[Short ](i)
238
241
239
242
/**
240
243
* Returns the value at position i as a primitive int.
241
244
*
242
245
* @throws ClassCastException when data type does not match.
246
+ * @throws SparkException when value is null.
243
247
*/
244
248
def getInt (i : Int ): Int = getAnyValAs[Int ](i)
245
249
246
250
/**
247
251
* Returns the value at position i as a primitive long.
248
252
*
249
253
* @throws ClassCastException when data type does not match.
254
+ * @throws SparkException when value is null.
250
255
*/
251
256
def getLong (i : Int ): Long = getAnyValAs[Long ](i)
252
257
@@ -255,13 +260,15 @@ trait Row extends Serializable {
255
260
* Throws an exception if the type mismatches or if the value is null.
256
261
*
257
262
* @throws ClassCastException when data type does not match.
263
+ * @throws SparkException when value is null.
258
264
*/
259
265
def getFloat (i : Int ): Float = getAnyValAs[Float ](i)
260
266
261
267
/**
262
268
* Returns the value at position i as a primitive double.
263
269
*
264
270
* @throws ClassCastException when data type does not match.
271
+ * @throws SparkException when value is null.
265
272
*/
266
273
def getDouble (i : Int ): Double = getAnyValAs[Double ](i)
267
274
@@ -516,6 +523,7 @@ trait Row extends Serializable {
516
523
*
517
524
* @throws UnsupportedOperationException when schema is not defined.
518
525
* @throws ClassCastException when data type does not match.
526
+ * @throws SparkException when value is null.
519
527
*/
520
528
private def getAnyValAs [T <: AnyVal ](i : Int ): T =
521
529
if (isNullAt(i)) throw DataTypeErrors .valueIsNullError(i)
0 commit comments