Java example throws: Error: Dimension "__coords" does not exist

Hi,

I’m trying to follow along with the Java examples from the Github repo/website, but when it comes to writing queries, I’m getting an error: [TileDB::Domain] Error: Dimension "__coords" does not exist when I use the method .setCoordinates (the sparse-write example on the website uses setCoords, which I’m guessing is just a typo). I’m assuming that the __coords dimension is being created internally, so I don’t think that I’m supposed to have created it myself.

To work arround this, I tried setting each dimension’s buffer individually (like the Go example), and that didn’t throw an error, but doesn’t seem to be working correctly either.

I’m using version 0.3.0 of the Java SDK, and I’ve built the libtiledbjni.so from the release-0.3.0 branch of TileDB-Java. I’m trying to write to a sparse array.

Is there an obvious thing that I’m missing, or is there a newer version of the Java library I should be using?

Technically I’m using Clojure, but I don’t think that that should have any impact. I can post a code snippet if that helps.

Thanks,
Michael

Hi Michael,

The reason you are getting this error is because some of the code you try to run contains either the getCoordinates() or setCoordinates() method. In TileDB 2.0.0 we started to treat dimensions (coordinates) as attributes, and we follow the same logic in Java. The examples in the TileDB-Java repo were outdated and that’s why you run into these issues.

We recently updated the examples, which you can find in the master branch of our Github repo: https://github.com/TileDB-Inc/TileDB-Java

Let us know if you run into any further issues. Any feedback would be really appreciated.

Best,
Victor

Hi Victor,

thanks for getting back to me. I figured it might be something like that, but I had thought I was using an older version of the TileDB core. I thought it might be like the Go library, and that the Java release 0.3.0 corresponded to core 1.3.0, but now that I’ve found the Version class I can see that it is 2.0.2.

I have managed to read and write data giving each dimension its own buffer. It worked fine on smaller test arrays, though I’m now getting a [TileDB::ChunkedBuffer] Error: Chunk read error; chunk unallocated error; I haven’t had a chance to dig into that, but I’m guessing I’ve mis-measured a buffer.

I’m sympathetic to the problem of documentation drift. Some little things that would help a lot would be to put the version number on the examples, and to add a note about how the library versions map to core versions.

Thanks again,
Michael

1 Like

@michael.raymond,

Thanks for reporting the Chunk read error;. We’ve identified the bug and have a fix pending at https://github.com/TileDB-Inc/TileDB/pull/1732 . We will be releasing the fix in 2.0.7 towards the end of this week or early next week. We’ll also update the Java maven jar when we release the fix.

For compatibility between the TileDB library version and the Java API version we do have a wiki article. This isn’t linked from the README, so its immediately easy to find. We’ll adjust the README to add a link so it is easier to find.

Thank you,

Seth

1 Like