GithubHelp home page GithubHelp logo

[NodeJS]: readIPC from buffer fails with 'Arrow file does not contain correct header', while it works in ArrowJS about nodejs-polars HOT 7 OPEN

0xgeert avatar 0xgeert commented on June 10, 2024 1
[NodeJS]: readIPC from buffer fails with 'Arrow file does not contain correct header', while it works in ArrowJS

from nodejs-polars.

Comments (7)

ritchie46 avatar ritchie46 commented on June 10, 2024 4

Ah.. Polars doesn't have that distinction no. So the IPC is the stream and the .arrow is the feather file as the IPC data + additional headers?

Then we must add this.

from nodejs-polars.

0xgeert avatar 0xgeert commented on June 10, 2024

from nodejs-polars.

ritchie46 avatar ritchie46 commented on June 10, 2024

The IPC readers are implemented upstream. Could you make this issue here? https://github.com/jorgecarleitao/arrow2

from nodejs-polars.

jorgecarleitao avatar jorgecarleitao commented on June 10, 2024

I am a bit surprised about pl.readIPC(fromArrow) and pl.readIPC(fromIPC): shouldn't these be two different signatures? One thing is to read a stream (.ipc), the other is a file (.arrow). I think that we are just missing a readIPCStream in Polars' API that can read arrow streams (as opposed to arrow files).

from nodejs-polars.

joshuataylor avatar joshuataylor commented on June 10, 2024

Hi!

I'm keen to get this into polars, as Snowflake uses this for their response format and would be awesome to get it in for reading data straight from SF into Polars.

Here is a quick primer about the streaming files from Arrow: https://arrow.apache.org/docs/python/ipc.html
And the guide here from arrow2 about reading the stream: https://jorgecarleitao.github.io/arrow2/io/ipc_stream_read.html

IMHO, supporting files initially is fine, later can do other streaming support.

I've started looking into this, and the major blocker I can see is projections.

In arrow2, projections are not supported here: https://github.com/jorgecarleitao/arrow2/blob/main/src/io/ipc/read/stream.rs#L185

So we will need to build the projection from the chunks.

Thoughts?

from nodejs-polars.

stinodego avatar stinodego commented on June 10, 2024

Transfering this to the NodeJS repo as I have no way to reproduce this using Python/Rust. Not sure if this is still relevant.

from nodejs-polars.

Bidek56 avatar Bidek56 commented on June 10, 2024

@stinodego
Python Polars 0.19.2 throws the same error on this file: exceptions.ArrowErrorException: OutOfSpec("InvalidHeader")

df = pl.read_ipc('https://paste.c-net.org/ViperMoronic')

It seems that .ipc file needs to start and end with ARROW1 for Polars to work

from nodejs-polars.

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.