File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { ascending , descending , reverse } from "d3-array" ;
2
2
import { FileAttachment } from "./fileAttachment.js" ;
3
+ import { isArrowTable } from "./arrow.js" ;
4
+ import { DuckDBClient } from "./duckdb.js" ;
3
5
4
6
const nChecks = 20 ; // number of values to check in each array
5
7
@@ -170,9 +172,13 @@ export async function loadDataSource(source, mode) {
170
172
switch ( source . mimeType ) {
171
173
case "application/x-sqlite3" : return source . sqlite ( ) ;
172
174
}
175
+ if ( / \. a r r o w $ / i. test ( source . name ) ) return DuckDBClient . of ( { __table : await source . arrow ( { version : 9 } ) } ) ;
173
176
}
174
177
throw new Error ( `unsupported file type: ${ source . mimeType } ` ) ;
175
178
}
179
+ if ( ( mode === "table" || mode === "sql" ) && isArrowTable ( source ) ) {
180
+ return DuckDBClient . of ( { __table : source } ) ;
181
+ }
176
182
return source ;
177
183
}
178
184
You can’t perform that action at this time.
0 commit comments