You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "pinduzera (via GitHub)" <gi...@apache.org> on 2023/03/29 20:02:23 UTC

[GitHub] [arrow] pinduzera opened a new issue, #34779: [R] write_* methods can't have socketConnection as a sink

pinduzera opened a new issue, #34779:
URL: https://github.com/apache/arrow/issues/34779

   ### Describe the enhancement requested
   
   I am trying to make a straight write to a raw socket replicating the python's implementation.
   For some reason yet unknown to me, sending a raw vector combining `arrow::write_to_raw(table)` and `writeBin()` but doesn't seem to be acceptable. And trying to send files by batches is not possible since it doesn't allow me to write to sockets directly, only to `OutputStream`, which doesn't allow socketConnection as well.
   
   ```r
   rbIris <- record_batch(iris)
   
   nDriver <- socketConnection(host = '127.0.0.1', 
                                port = 1234,
                                blocking = TRUE,
                                server = FALSE,
                                open = "w+b")
   
   writer <- arrow::RecordBatchStreamWriter$create(nDriver , rbIris$schema)
   ```
   
   `Error: sink must be a "OutputStream"`
   
   ### Component(s)
   
   R


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on issue #34779: [R] write_* methods can't have socketConnection as a sink

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #34779:
URL: https://github.com/apache/arrow/issues/34779#issuecomment-1491948867

   Thank you for opening this...we should absolutely be able to write an IPC stream over a socket!
   
   I believe this is a result of the way we wrap an R connection with an OutputStream and/or InputStream. I believe there's a place where we attempt a seek to see if we can get a random access file (needed for some types of files like parquet and arrow non-stream files). I think we check `isSeekable(con)` but I think there are some types of connections where that returns `TRUE` even though any attempt to actually seek will fail.
   
   For reference: https://github.com/apache/arrow/blob/main/r/src/io.cpp#L210-L410


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pinduzera commented on issue #34779: [R] write_* methods can't have socketConnection as a sink

Posted by "pinduzera (via GitHub)" <gi...@apache.org>.
pinduzera commented on issue #34779:
URL: https://github.com/apache/arrow/issues/34779#issuecomment-1491827431

   As an additional:
   When trying to use `write_ipc_stream(iris, conn)`  I receive the following error, which is I am not sure if it is any restriction o Arrow or R sockets, the error is a little different, which is strange since `write_ipc_stream` calls arrow::RecordBatchStreamWriter`. Maybe failing even earlier?
   
   ```Error in seek.connection(4L) : 'seek' not enabled for this connection```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org