Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.0.0, 0.7.0, 0.6.1
-
None
-
None
Description
Today the PutHBaseCell processor makes the assumption that all row keys are text. However, this does not work when the row key in the HBase table is binary.
If the row key is specified in the binary string format, such as:
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\x
00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x00\x00\x00\x00\x01\x00\x00\x01\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x01\x00\x00\x01\x00\x00\x00\x00\x01
\x01\x01\x00\x01\x00\x01\x01\x01\x00\x00\x
00\x00\x00\x00\x01\x01\x01\x01\x00\x00\x00
\x00\x00\x00\x01\x01\x00\x01\x00\x01\x00\x
00\x01\x01\x01\x01\x00\x00\x01\x01\x01\x00
\x01\x00\x00
Which is the textual representation that the HBase CLI would return, NiFi calls getBytes on that string. Appropriately HBase will encode the '\' with the hex code: x5C, resulting in an output string that looks like:
x5Cx00\x5Cx00\ ...........
To address this the proposed solution would be to:
- Add "toBytesBinary" method to HBaseClientService similar to the ones already added [1].
- Update the PutFlowFile and PutColumn to pass around mostly byte[] and not strings that they do today.
For this JIRA only support for Text and Binary will be added for the RowKey
Attachments
Issue Links
- links to