felipecrv commented on code in PR #34: URL: https://github.com/apache/arrow-experiments/pull/34#discussion_r1743950017
########## http/get_simple/curl/client/README.md: ########## @@ -0,0 +1,62 @@ +<!--- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +# 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. + +To read the file `output.arrows` and view 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: + +### Python Review Comment: ```suggestion ### Python parser ``` ########## http/get_simple/curl/client/README.md: ########## @@ -0,0 +1,62 @@ +<!--- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +# 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. + +To read the file `output.arrows` and view 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: + +### Python + +```py +import pyarrow as pa + +with open("output.arrows", "rb") as f: + reader = pa.ipc.open_stream(pa.BufferReader(f.read())) + +schema = reader.schema + +batch = reader.read_next_batch() +# ... + +# or alternatively: +batches = [b for b in reader] +``` + +### R Review Comment: ```suggestion ### R parser ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
