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 11import { ascending , descending , reverse } from "d3-array" ;
22import { FileAttachment } from "./fileAttachment.js" ;
3+ import { isArrowTable } from "./arrow.js" ;
4+ import { DuckDBClient } from "./duckdb.js" ;
35
46const nChecks = 20 ; // number of values to check in each array
57
@@ -170,9 +172,13 @@ export async function loadDataSource(source, mode) {
170172 switch ( source . mimeType ) {
171173 case "application/x-sqlite3" : return source . sqlite ( ) ;
172174 }
175+ if ( / \. a r r o w $ / i. test ( source . name ) ) return DuckDBClient . of ( { __table : await source . arrow ( { version : 9 } ) } ) ;
173176 }
174177 throw new Error ( `unsupported file type: ${ source . mimeType } ` ) ;
175178 }
179+ if ( ( mode === "table" || mode === "sql" ) && isArrowTable ( source ) ) {
180+ return DuckDBClient . of ( { __table : source } ) ;
181+ }
176182 return source ;
177183}
178184
You can’t perform that action at this time.
0 commit comments