Let say I have three rows with following values:
+------+----------+ | row | f1:c1 | +------+----------+ | row1 | \x00\x00 | | row2 | \x01\x00 | | row3 | \x03\x01 | +------+----------+
Is it possible to select rows with \x00 as second byte of the value (eg. row1 and row2)?
Further explanation
I have an immutable object that consists of couple UUIDs as a part of my entity. Since UUID has fixed length the most efficient way of storing it is to concat all parts into a single byte array and store it in a single column.
However, I must be able to select rows based on specific field of said object. Which in theory is pretty simple: all I need to do is take my column value at specific offset and compare next 16 bytes against search value.
In fact ByteArrayComparable already kinda works that way. It takes an offset that points to the start of the value, and it seems that all I need is to add additional offset on top of that. But I cannot figure out how to do that.
All in all, this seems to me like a widely applicable use case. So there must be a way to do it, unless I am missing something.
P.S. I know that I can probably achieve what I want with RegexStringComparator but this seems wildly inefficient.
UPDATE
HBase supports custom filters which is perfect for my situation. Unfortunately all documentation I can find seems outdated since hbase.dynamic.jars.dir and hbase.use.dynamic.jar are not present in my configuration (my version is 2.0.1).
UPDATE 2
I managed to solve this with custom filter. It appears that they removed hbase.dynamic.jars.dir and hbase.use.dynamic.jar, but simply placing filter on the classpath works fine.
If anyone willing to write an answer on how to implement and use custom filter I will gladly award the bounty.