[Spark 2060][SQL] Querying JSON Datasets with SQL and DSL in Spark SQL

JIRA: https://issues.apache.org/jira/browse/SPARK-2060
These sorts of casts are only going to do what you want if the type of value isn't `Any`

```scala
scala> 1L.asInstanceOf[Int]
res0: Int = 1

scala> (1L: Any).asInstanceOf[Int]
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
```