-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display and accept binary HBase data in escaped form #3729
Comments
Hi @stoty and thanks for reaching out. Can you provide an screenshot example of how this looks in HBase for a clearer picture? |
Creating and displaying binary data in hbase shell:
As you can see, the binary values are entered as escaped hex characters, and the results are displayed the same way. The same data in Hue looks like this: The easiest and most HBase-like solution would be using the same hex escaped format in Hue. This could be a toggle in the toolbar for backward compatibility. |
For ease of identification, I have used an ascii prefix, but the data is often pure binary, like a long or an integer. |
Thanks, let's leave this issue open to see if any one in the community can create a PR for it. |
#77 is a similar issue. |
This issue is stale because it has been open 30 days with no activity and is not labeled "Prevent stale". Remove "stale" label or comment or this will be closed in 10 days. |
Fot the record this is NOT completed. |
It would be cool to implement this task |
@MikhailShapovalov26 Cool, why don't you give it a go? |
Description
Much of the time data in HBase (not just values, but often rowkeys and even the column qualifier) is binary, with the encoding determined by an application.
Currently Hue is incapable of displaying these in a usable manner. It tries to interpret the data as an (UTF-8 ?) string, and the ouput is full of placeholders for unprintable characters. (at least I was not able to change this from the UI)
Due to the lack of standard encodings, and metadata on the encoding, it is not possible to display the decoded contents in a reliable manner.
This same problem is solved in HBase shell by escaping binary data. Bytes that are printable ASCII characters are displayed as their ASCII character value, while bytes outside this range are displayes as escaped hex codes.
While this is still not a super-user friendly format, most HBase users are familiar with it, and have workflows to handle it.
I propose doing the same in Hue, using the same encoding to display all data (that is not otherwise identfied and handled).
Additionally, this encoding could also be supported in the editor, by accepting an escaped string and converting to its binary representation.
The escaping code is very simple, these are the java methods for escaping / unescaping:
https://github.com/apache/hbase/blob/156e430dc56211c0aea15d792e8733b1b0e3de5c/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java#L574
https://github.com/apache/hbase/blob/156e430dc56211c0aea15d792e8733b1b0e3de5c/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java#L607
There are further possible enhancements like being able to interpret the data as hex strings, or being able to switch the data encoding for cells/rows etc dynamicall to one of the standard encodings in org.apache.hadoop.hbase.util.Bytes, but those are less critical, and can be handled separately.
The text was updated successfully, but these errors were encountered: