Danger zone! If T is primitive, and the column is NULL, we explicitly cast null to T which will result in unexpected results:
Danger zone! If T is primitive, and the column is NULL, we explicitly cast null to T which will result in unexpected results:
null.asInstanceOf[Int] // 0 null.asInstanceOf[Boolean] // false
And so forth. Therefore, use of get
is discouraged, with getOption
or getTry
preferred.
Danger zone! See get[T](Int) below