[
https://issues.apache.org/jira/browse/HBASE-10071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839981#comment-13839981
]
cuijianwei commented on HBASE-10071:
------------------------------------
[~ndimiduk] thanks for your comment. I go through the DataType implementation
in 0.96 and find there are OrderedTypes(OrderedFloat32,...) and
RawTypes(RawInteger...). To support all data types, we might need some utility
methods to parse Java object from corresponding DataType? For OrderedTypes, we
might implement a method :
{code}
public Object parseJavaDataObjectFromOrderedBytes(PositionedBytesRange bytes);
{code}
The specified data type could be determined when decoding the OrderedType
bytes.
For RawTypes, we might implement a method:
{code}
public Object parseJavaDataObjectFromRawBytes(PositionedBytesRange bytes,
String type);
{code}
The parameter 'type' could be 'int/long/short/...' with which we can determine
the data type of RowType bytes.
Then, we can invoke the above two methods in hbase shell. I am not very
familiar with the details of DataType in 0.96, maybe, we can use a better way?
> support data type for get/scan in hbase shell
> ---------------------------------------------
>
> Key: HBASE-10071
> URL: https://issues.apache.org/jira/browse/HBASE-10071
> Project: HBase
> Issue Type: Improvement
> Components: Client
> Affects Versions: 0.94.14
> Reporter: cuijianwei
> Attachments: HBASE-10071-0.94-v1.patch
>
>
> Users tend to run hbase shell to query hbase quickly. The result will be
> shown as binary format which may not look clear enough when users write
> columns using specified types, such as long/int/short. Therefore, it may be
> helpful if the results could be shown as specified format. We make a patch to
> extend get/scan in hbase shell in which user could specify the data type in
> get/scan for each column as:
> {code}
> scan 'table', {COLUMNS=>['CF:QF:long']}
> get 'table', 'r0', {COLUMN=>'CF:QF:long'}
> {code}
> Then, the result will be shown as Long type. The result of above get will be:
> {code}
> COLUMN CELL
>
>
> CF:QF timestamp=24311261, value=24311229
> {code}
> This extended format is compatible with previous format, if users do not
> specify the data type, the command will also work and output binary format.
--
This message was sent by Atlassian JIRA
(v6.1#6144)