UDOs filling MemArray



I have developed a couple of UDOs and stoped working as soon as I tried to use them with the newer SciDB released. I suspect it is a config issue and will resolve that on my own, but there was something I wanted to ask a while back and neglected to.

The UDOs I developed used a Tuple and my result Array was a TupleArray
for example something like:

shared_ptr<Array> writeStatsToMemArray(...) { vector< boost::shared_ptr<Tuple> > tuples( size ); for ( int i=0; i<size; i++ ) { boost::shared_ptr<Tuple> tuple( new Tuple(2) ); (*tuple)[0].setUint64( 1234); (*tuple)[1].setUint64( 5678); tuples[i] = boost::shared_ptr<Tuple>(tuple); } return boost::shared_ptr<Array>(new TupleArray(_schema, tuples, Coordinate(query->getInstanceID()))); }

That works fine, but on the example UDOs I noticed that a different API is used.

Will the much simpler way I am using will be supported or I should get familiar with the newer one ?



The UDOs probably will need to be rebuilt with the new release. Let me know if there are other issues.

I do recommend using MemArray instead of the TupleArray. For multiple reasons:

  • you can populate a multidimensional MemArray
  • chunks that are not currently opened (no iterators) are on an LRU cache and eligible to be swapped to disk; you can write arrays that are larger than memory
  • indeed, the fate of TupleArray is not so certain, it could be removed soon

Hope it helps.


Thanks Alex,
One more thing I wanted to ask… :smile:

Seems that building with C++ 11 is not possible, looks like some incompatibility between boost and the c++11 namespace.

I admit I haven’t spend any time to try to resolve it, but I am wondering if anyone was able to build UDOs (or any UD*) using the -std=c++0x or -std=c++11 compiler flags ??

For now I am using ::tr1 but would be nice to be able to take advantage of the newer and cooler C++ features.


Understood. Good question. We talked about it for a bit ( :smile: ) but we haven’t tried it yet.
I’m guessing you might be running into some namespace collisions with boost objects? Interested to know what you find…