Code Monkey home page Code Monkey logo

Comments (3)

sambonbonne avatar sambonbonne commented on July 29, 2024

If it can help you, I managed to do it by using pure stream, but I don't know if appendRow is compatible with stream mode:

  1. I receive my stream from a request, here I will name it sourceStream (you need to create your own Readable stream I guess)
  2. I create a ParquetTransformer, here I will name it parquetStream and pipe it to sourceStream
  3. I create an AWS S3 putObjectRequest with the stream as Body, using the official AWS SDK
// say we already have sourceStream and `parquetStream`
s3Bucket.upload({
  Bucket: 'bucketName',
  Key: 'path/of/the/file',
  Body: sourceStream.pipe(parquetStream)
}); // here I do a .promise() but this is for my usage

Using stream can have the advantage of saving RAM.

from parquetjs.

eliasrosa avatar eliasrosa commented on July 29, 2024

@sambonbonne, my friend!

Can you put a more complete example, please!

I don't understand anything about stream.

Thank you very much!

from parquetjs.

sambonbonne avatar sambonbonne commented on July 29, 2024

@eliasrosa I'm sorry, I don't know how to make a more complete example. I can add some variables or something but I'm not sure it will help:

const parquetStream = new ParquetTransformer({ /* your parquet and transform parameters */ });

// saying you already have a Readable source stream as sourceStream
const conversionStream = sourceStream.pipe(parquetStream);

s3Bucket.upload({
  Bucket: 'bucketName',
  Key: 'path/of/the/file',
  Body: conversionStream
});

I don't want to discourage you but I think you should not try to use streams without understanding those. Streams are important in NodeJS and have multiple advantages, maybe learning more about streams would be useful for you if you use NodeJS.

(I hope you won't take this answer as an attack, I just don't know how I can help better)

from parquetjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.