@@ -33,11 +33,7 @@ public class SessionDataSet : System.IDisposable
3333 private readonly List < string > _columnNames ;
3434 private readonly Dictionary < string , int > _columnNameIndexMap ;
3535 private readonly List < string > _columnTypeLst ;
36- private readonly int _columnSize ;
37- private List < ByteBuffer > _valueBufferLst , _bitmapBufferLst ;
3836 private Client _client ;
39- private int _rowIndex ;
40- private RowRecord _cachedRowRecord ;
4137 private bool _isClosed = false ;
4238 private bool disposedValue ;
4339 private RpcDataSet _rpcDataSet ;
@@ -52,35 +48,28 @@ public class SessionDataSet : System.IDisposable
5248 public SessionDataSet (
5349 string sql , List < string > ColumnNameList , List < string > ColumnTypeList ,
5450 Dictionary < string , int > ColumnNameIndexMap , long QueryId , long statementId , Client client , List < byte [ ] > QueryResult ,
55- bool IgnoreTimeStamp , bool MoreData , string zoneId , List < int > ColumnIndex2TsBlockColumnIndexList , ConcurrentClientQueue _clientQueueS
51+ bool IgnoreTimeStamp , bool MoreData , string zoneId , List < int > ColumnIndex2TsBlockColumnIndexList , ConcurrentClientQueue clientQueue
5652 )
5753 {
5854 _client = client ;
5955 _sql = sql ;
6056 _queryId = QueryId ;
6157 _statementId = statementId ;
62- _columnSize = ColumnNameList . Count ;
6358 _columnNameIndexMap = ColumnNameIndexMap ;
64- _rowIndex = 0 ;
6559
6660 _columnNames = ColumnNameList ;
6761 _columnTypeLst = ColumnTypeList ;
6862 _zoneId = zoneId ;
69- _clientQueue = _clientQueueS ;
70-
63+ _clientQueue = clientQueue ;
64+
7165 _rpcDataSet = new RpcDataSet (
7266 _sql , _columnNames , _columnTypeLst , _columnNameIndexMap , IgnoreTimeStamp ,
7367 MoreData , _queryId , _statementId , _client , _client . SessionId , QueryResult , FetchSize ,
7468 DefaultTimeout , _zoneId , ColumnIndex2TsBlockColumnIndexList
7569 ) ;
7670 }
77- public bool HasNext ( )
78- {
79- if ( _rpcDataSet . HasCachedRecord ) return true ;
80- return Next ( ) ;
81- }
82-
83- public bool Next ( ) => _rpcDataSet . Next ( ) ;
71+ public bool HasNext ( ) => _rpcDataSet . Next ( ) ;
72+ public RowRecord Next ( ) => _rpcDataSet . GetRow ( ) ;
8473 public bool IsNull ( string columnName ) => _rpcDataSet . IsNullByColumnName ( columnName ) ;
8574 public bool IsNullByIndex ( int columnIndex ) => _rpcDataSet . IsNullByIndex ( columnIndex ) ;
8675
@@ -119,9 +108,7 @@ public bool HasNext()
119108 public IReadOnlyList < string > GetColumnNames ( ) => _rpcDataSet . _columnNameList ;
120109 public IReadOnlyList < string > GetColumnTypes ( ) => _rpcDataSet . _columnTypeList ;
121110
122- public RowRecord GetRow ( ) => _rpcDataSet . GetRow ( ) ;
123111 public int RowCount ( ) => _rpcDataSet . _tsBlockSize ;
124-
125112 public void ShowTableNames ( )
126113 {
127114 IReadOnlyList < string > columns = GetColumnNames ( ) ;
@@ -173,8 +160,6 @@ protected virtual void Dispose(bool disposing)
173160 {
174161 }
175162 }
176- _valueBufferLst = null ;
177- _bitmapBufferLst = null ;
178163 disposedValue = true ;
179164 }
180165 }
0 commit comments