[SPARK-1822] SchemaRDD.count() should use query optimizer