the error may be here, the code is genrated by thrift4go and hbase.thrift. I will add some comments in
the codes to describe my question.
func (p _TRowResult) ReadField2(iprot thrift.TProtocol) (err thrift.TProtocolException) {
_ktype72, _vtype73, size71, err := iprot.ReadMapBegin()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "p.Columns", "", err)
}
/ ======================================================
* fmt.Println(_ktype72)
* the type of "ktype72" is STRING
========================================================/
p.Columns = thrift.NewTMap(_ktype72, _vtype73, _size71)
for _i75 := 0; _i75 < _size71; _i75++ {
v78, err79 := iprot.ReadBinary()
if err79 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_key76", "", err79)
}
key76 := Text(v78) / =============(Text: type Text []byte)====================*/
_val77 := NewTCell()
err82 := _val77.Read(iprot)
if err82 != nil {
return thrift.NewTProtocolExceptionReadStruct("_val77TCell", err82)
}
/*=================================================
* the type of _key76 is Text, not []bye. p.Columns is a thrift map.
* when the _key76 is Text, the method of Set can't put the key-value into map.
* if I modify the code, to call "p.Columns.Set([]byte(_key76), _val77)", it's well.
* I follow the error, can arrived the function "func (p TType) CoerceData(data interface{}) (interface{}, bool)". Of course, the "case STRING" of the function don't handle Text type, so not work well.
*=================================================
*/
p.Columns.Set(_key76, _val77)
}
err = iprot.ReadMapEnd()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
}
return err
}
I hope the bug can be fixed as soon as possible.
Thank you.
I use thrift4go and the IDL file of hbase.thrift (http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift?view=markup), but I find thrift4go not work well.
the error may be here, the code is genrated by thrift4go and hbase.thrift. I will add some comments in the codes to describe my question.
func (p _TRowResult) ReadField2(iprot thrift.TProtocol) (err thrift.TProtocolException) { _ktype72, _vtype73, size71, err := iprot.ReadMapBegin() if err != nil { return thrift.NewTProtocolExceptionReadField(-1, "p.Columns", "", err) } / ====================================================== * fmt.Println(_ktype72) * the type of "ktype72" is STRING ========================================================/ p.Columns = thrift.NewTMap(_ktype72, _vtype73, _size71) for _i75 := 0; _i75 < _size71; _i75++ { v78, err79 := iprot.ReadBinary() if err79 != nil { return thrift.NewTProtocolExceptionReadField(0, "_key76", "", err79) } key76 := Text(v78) / =============(Text: type Text []byte)====================*/ _val77 := NewTCell() err82 := _val77.Read(iprot) if err82 != nil { return thrift.NewTProtocolExceptionReadStruct("_val77TCell", err82) }
}
I hope the bug can be fixed as soon as possible. Thank you.