liuxiaocs7 opened a new pull request, #8461:
URL: https://github.com/apache/hbase/pull/8461
### Problem
Running `list_labels` in the hbase shell echoes the raw protobuf return
value:
```
hbase> list_labels
A
B
=> #<Java::OrgApacheHbaseThirdpartyComGoogleProtobuf::ProtobufArrayList:
[#<...ByteString...>, ...]>
```
The `command` method ends with `list.each { ... }`. In Ruby `each` returns
its receiver, so the method implicitly returns the internal
`ProtobufArrayList<ByteString>`, which the shell (IRB) then inspects.
Found while working on HBASE-30266.
### Fix
Collect the label strings into a Ruby array and return it, so the echo
becomes readable and consistent with the `list` command (which already
returns a Ruby array of table names):
```
hbase> list_labels
A
B
=> ["A", "B"]
```
The printed rows are unchanged; only the return value is converted from the
internal protobuf list to a readable `Array<String>`. No test or internal
code consumes the previous return value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]