Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

HTTP GET Arrow Data: Simple curl Client Example

This directory contains a simple curl command that:

  1. Sends an HTTP GET request to a server.
  2. Receives an HTTP 200 response from the server, with the response body containing an Arrow IPC stream of record batches.
  3. Writes the stream of record batches to an Arrow IPC stream file with filename output.arrows.

To run this example, first start one of the server examples in the parent directory, then run the curl command.

Reading the Resulting Arrow IPC Stream File

To read the resulting file output.arrows and retrieve the schema and record batches that it contains, you can use one of the code examples below, or use similar examples in other languages that have Arrow implementations. You can also read the file with any application that supports reading data in the Arrow IPC streaming format.

Example: Read Arrow IPC stream file with Python
import pyarrow as pa

with open("output.arrows", "rb") as f:
    reader = pa.ipc.open_stream(f)
    
    schema = reader.schema
    
    batch = reader.read_next_batch()
    # ...
    
    # or alternatively:
    batches = [b for b in reader]
Example: Read Arrow IPC stream file with R
library(arrow)

reader <- RecordBatchStreamReader$create(ReadableFile$create("output.arrows"))

schema <- reader$schema

batch <- reader$read_next_batch()
# ...

# or alternatively:
table <- reader$read_table()