/// <summary> /// Returns all of Rows in this DataFrame /// </summary> public IEnumerable <Row> Collect() { if (rowSchema == null) { rowSchema = RowSchema.ParseRowSchemaFromJson(Schema.ToJson()); } IRDDProxy rddProxy = dataFrameProxy.JavaToCSharp(); RDD <Row> rdd = new RDD <Row>(rddProxy, sparkContext, SerializedMode.Row); int port = rddProxy.CollectAndServe(); foreach (var item in rdd.Collect(port)) { yield return(new RowImpl(item, rowSchema)); } }