public IEnumerator <T> GetEnumerator() { CheckDisposed(); ChoParquetRecordReader rr = new ChoParquetRecordReader(typeof(T), Configuration); if (_streamReader != null) { _parquetReader = Create(_streamReader.Value); } rr.Reader = this; rr.TraceSwitch = TraceSwitch; rr.RowsLoaded += NotifyRowsLoaded; rr.BeforeRowGroupLoad += BeforeRowGroupLoad; rr.AfterRowGroupLoaded += AfterRowGroupLoaded; rr.MembersDiscovered += MembersDiscovered; rr.RecordFieldTypeAssessment += RecordFieldTypeAssessment; var beforeRowGroup = BeforeRowGroupLoad; var afterRowGroup = AfterRowGroupLoaded; if (beforeRowGroup != null || afterRowGroup != null) { rr.InterceptRowGroup = true; } var e = rr.AsEnumerable(_parquetReader).GetEnumerator(); return(ChoEnumeratorWrapper.BuildEnumerable <T>(() => { ++_recordNumber; return e.MoveNext(); }, () => (T)ChoConvert.ChangeType <ChoRecordFieldAttribute>(e.Current, typeof(T)), () => Dispose()).GetEnumerator()); }
public IEnumerator <T> GetEnumerator() { ChoParquetRecordReader rr = new ChoParquetRecordReader(typeof(T), Configuration); if (_sr != null) { _parquetReader = Create(_sr); } rr.Reader = this; rr.TraceSwitch = TraceSwitch; rr.RowsLoaded += NotifyRowsLoaded; rr.MembersDiscovered += MembersDiscovered; rr.RecordFieldTypeAssessment += RecordFieldTypeAssessment; var e = rr.AsEnumerable(_parquetReader).GetEnumerator(); return(ChoEnumeratorWrapper.BuildEnumerable <T>(() => e.MoveNext(), () => (T)ChoConvert.ChangeType <ChoRecordFieldAttribute>(e.Current, typeof(T)), () => Dispose()).GetEnumerator()); }