@@ -42,14 +42,18 @@ export class TableView {
42
42
private _disposables : Disposable [ ] = [ ] ;
43
43
44
44
// tabular data vars
45
+ private _tableSchema : any ;
45
46
private _tableData : [ ] = [ ] ;
46
47
private _currentDataPage : number = 0 ;
47
48
private _totalRows : number = 0 ;
48
49
49
- // default page data size for data streaming setup
50
- // TODO: move this to tabular data viewer config options later
50
+ // TODO: move the settings below to tabular data viewer config options later
51
+ // default page data size for incremental data loading into table view
51
52
private readonly _pageDataSize : number = 1000 ;
52
53
54
+ // infer table schema rows sample size limit
55
+ private readonly _inferDataSize = 100 ;
56
+
53
57
/**
54
58
* Reveals current table view or creates new table webview panel for tabular data display.
55
59
*
@@ -198,14 +202,14 @@ export class TableView {
198
202
const table = await Table . load ( this . _documentUri . fsPath ) ;
199
203
200
204
// infer table shema
201
- const tableInfo = await table . infer ( ) ;
202
- console . log ( 'tabular.data.view:tableInfo:' , tableInfo ) ;
205
+ this . _tableSchema = await table . infer ( this . _inferDataSize ) ;
206
+ console . log ( 'tabular.data.view:tableInfo:' , this . _tableSchema ) ;
203
207
204
208
// read all table data rows
205
209
const tableData : [ ] = await table . read ( { keyed : true } ) ;
206
210
this . logTableData ( tableData , table . headers ) ;
207
211
208
- // save table data for incrementally loading into table view later
212
+ // save table data for incremental load into table view later
209
213
this . _tableData = tableData ;
210
214
this . _totalRows = this . _tableData . length ;
211
215
0 commit comments