You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm no stream expert, but given the examples, it seemed like it would be super easy to create a transform stream with your module.
I am able to verify that it works fine when running like the example in the readme, but when I port it into a custom Transform stream, it ends super early, doesn't hit the writeable, and I get no errors. There's a good chance this isn't a problem with uDSV, but it's strange, given your apis, this should work.
// lines = 16_182_971 , 100% finished in 13.1 seconds = 1_235_341 rows per second// 597.5 MB 13.1s 45.5MB/sconststreamedCSV=async()=>{constfileSize=awaitfs.promises.stat(filePath).then((stats)=>stats.size)conststream=fs.createReadStream(filePath).pipe(newProgressBarStream(fileSize))letparser: Parser;forawait(constbufferofstream){conststrChunk=buffer.toString();parser??=initParser(inferSchema(strChunk));parser.chunk<string[]>(strChunk,parser.typedArrs,(batch)=>{constx=batch// reaches here fine});}parser!.end();}consttransform=async()=>{constfileSize=awaitfs.promises.stat(filePath).then((stats)=>stats.size)returnnewPromise<void>((resolve,reject)=>{pipeline(fs.createReadStream(filePath),newSimpleUDSVTransform(),newWritable({write(chunk,encoding,callback){constx=chunk// never reaches herecallback()}}),(err)=>{if(err){reject(err)// never reaches here}else{resolve()// never reaches here}})})}(async()=>{awaitstreamedCSV()//worksawaittransform()//breaks})()
The text was updated successfully, but these errors were encountered:
yeah for sure, I just created a example repo you can use to run everything. just run example.ts
I plopped in some random csv I found online, but really, any CSV will work to repro this issue it seems like
But regarding the api, I think the way to get it to work with streams is to use the chunk function, which seems to be async right now. I imagine it should be able to be synchronous though too though, since there shouldn't be a reason for the parser to not be able to give us what it's already got so far in a sync way?
But either way, whether its sync or async, it really doesn't matter to a Transform stream, which is why I'm so confused why it just stops and ends so soon
I'm no stream expert, but given the examples, it seemed like it would be super easy to create a transform stream with your module.
I am able to verify that it works fine when running like the example in the readme, but when I port it into a custom Transform stream, it ends super early, doesn't hit the writeable, and I get no errors. There's a good chance this isn't a problem with uDSV, but it's strange, given your apis, this should work.
The text was updated successfully, but these errors were encountered: