I'm trying to efficiently allow conversion of R objects to PostgreSQL bytea (raw binary) datatype within PL/R for persistent storage in Postgres tables. I have found R_serialize() which looks like what I need, -- e.g. R_serialize(object, NULL, FALSE, NULL) -- except that it is marked attribute_hidden. Is there some other externally available interface that I can use? Thanks, Joe
external equiv to R_serialize()?
4 messages · Brian Ripley, Joe Conway
On Mon, 30 Mar 2009, Joe Conway wrote:
I'm trying to efficiently allow conversion of R objects to PostgreSQL bytea (raw binary) datatype within PL/R for persistent storage in Postgres tables. I have found R_serialize() which looks like what I need, -- e.g. R_serialize(object, NULL, FALSE, NULL) -- except that it is marked attribute_hidden. Is there some other externally available interface that I can use?
R_Serialize is in Rinternals.h. R_serialize is a wrapper using connections, and connections do not have a public API. Do note the comments in ?serialize: 'persistent' storage of objects in an experimental format is somewhat contradictory.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian Ripley wrote:
On Mon, 30 Mar 2009, Joe Conway wrote:
I'm trying to efficiently allow conversion of R objects to PostgreSQL bytea (raw binary) datatype within PL/R for persistent storage in Postgres tables. I have found R_serialize() which looks like what I need, -- e.g. R_serialize(object, NULL, FALSE, NULL) -- except that it is marked attribute_hidden. Is there some other externally available interface that I can use?
R_Serialize is in Rinternals.h. R_serialize is a wrapper using connections, and connections do not have a public API.
OK, thanks.
Do note the comments in ?serialize: 'persistent' storage of objects in an experimental format is somewhat contradictory.
Good point -- I'll put a suitable warning in my documentation. The typical use case people describe is more of a "materialized view" than it is primary storage, so I think this is still very useful. Thank you for your response. Joe
Prof Brian Ripley wrote:
On Mon, 30 Mar 2009, Joe Conway wrote:
I'm trying to efficiently allow conversion of R objects to PostgreSQL bytea (raw binary) datatype within PL/R for persistent storage in Postgres tables. I have found R_serialize() which looks like what I need, -- e.g. R_serialize(object, NULL, FALSE, NULL) -- except that it is marked attribute_hidden. Is there some other externally available interface that I can use?
R_Serialize is in Rinternals.h. R_serialize is a wrapper using connections, and connections do not have a public API.
Sorry if I'm missing something, but it seems that although R_Serialize() is public, the support functions needed to use R_outpstream_t are not. So I'm back to my initial question -- is there an alternative public interface that I can use? Thanks, Joe