MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / getLongByTsBlockColumnIndex

Method getLongByTsBlockColumnIndex

client/rpcdataset.go:442–465  ·  view source on GitHub ↗
(tsBlockColumnIndex int32)

Source from the content-addressed store, hash-verified

440}
441
442func (s *IoTDBRpcDataSet) getLongByTsBlockColumnIndex(tsBlockColumnIndex int32) (int64, error) {
443 if err := s.checkRecord(); err != nil {
444 return 0, err
445 }
446 if tsBlockColumnIndex < 0 {
447 s.lastReadWasNull = false
448 return s.curTsBlock.GetTimeByIndex(s.tsBlockIndex)
449 }
450 if !s.isNull(tsBlockColumnIndex, s.tsBlockIndex) {
451 s.lastReadWasNull = false
452 dataType := s.curTsBlock.GetColumn(tsBlockColumnIndex).GetDataType()
453 if dataType == INT32 {
454 if v, err := s.curTsBlock.GetColumn(tsBlockColumnIndex).GetInt(s.tsBlockIndex); err != nil {
455 return 0, err
456 } else {
457 return int64(v), nil
458 }
459 }
460 return s.curTsBlock.GetColumn(tsBlockColumnIndex).GetLong(s.tsBlockIndex)
461 } else {
462 s.lastReadWasNull = true
463 return 0, nil
464 }
465}
466
467func (s *IoTDBRpcDataSet) getBinaryByIndex(columnIndex int32) (*Binary, error) {
468 if index, err := s.getTsBlockColumnIndexForColumnIndex(columnIndex); err != nil {

Callers 3

getLongByIndexMethod · 0.95
getLongMethod · 0.95

Calls 7

checkRecordMethod · 0.95
isNullMethod · 0.95
GetTimeByIndexMethod · 0.80
GetColumnMethod · 0.80
GetDataTypeMethod · 0.65
GetIntMethod · 0.65
GetLongMethod · 0.65

Tested by

no test coverage detected