@@ -19,7 +19,13 @@ import {
1919} from '@kepler.gl/processors' ;
2020import { KeplerTable } from '@kepler.gl/table' ;
2121import { Field } from '@kepler.gl/types' ;
22- import { getApplicationConfig , DatabaseAdapter , DatabaseConnection } from '@kepler.gl/utils' ;
22+ import {
23+ getApplicationConfig ,
24+ DatabaseAdapter ,
25+ DatabaseConnection ,
26+ isArrowTable ,
27+ isArrowVector
28+ } from '@kepler.gl/utils' ;
2329
2430import {
2531 processCsvRowObject ,
@@ -161,10 +167,9 @@ export class KeplerGlDuckDbTable extends KeplerTable {
161167 try {
162168 // 1) data.rows contains an arrow table created by Add to Map data from DuckDb query.
163169 // 2) arrow table is in cols & fields when a file is dragged & dropped into Add Data To Map dialog.
164- const arrowTable =
165- data . rows instanceof arrow . Table
166- ? data . rows
167- : restoreArrowTable ( data . cols || [ ] , data . fields , data . arrowSchema ) ;
170+ const arrowTable = isArrowTable ( data . rows )
171+ ? data . rows
172+ : restoreArrowTable ( data . cols || [ ] , data . fields , data . arrowSchema ) ;
168173
169174 // remove unsupported extensions from an arrow table that throw exceptions in DuckDB.
170175 adjustedMetadata = removeUnsupportedExtensions ( arrowTable ) ;
@@ -215,7 +220,7 @@ export class KeplerGlDuckDbTable extends KeplerTable {
215220 format = DATASET_FORMATS . row ;
216221 } else if ( data . rows ?. type === 'FeatureCollection' ) {
217222 format = DATASET_FORMATS . geojson ;
218- } else if ( data . cols ?. [ 0 ] instanceof arrow . Vector ) {
223+ } else if ( isArrowVector ( data . cols ?. [ 0 ] ) ) {
219224 format = DATASET_FORMATS . arrow ;
220225 }
221226 }
0 commit comments