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