src/codec/RowReaderV1.cpp
/************************************************************
 *
 *  Get the property value from the serialized binary string
 *
 ***********************************************************/
Get the property value from the serialized binary string
Get the property value from the serialized binary string
Value RowReaderV1::getBool(int64_t index) const noexcept {
  RR_GET_OFFSET()
  Value v;
  switch (getSchema()->getFieldType(index)) {
    case PropertyType::BOOL: {
      v.setBool(intToBool(buffer_[offset]));
      offset++;
      break;
    }
    case PropertyType::INT64: {
      int64_t intV;
      int32_t numBytes = readInteger(offset, intV);
      if (numBytes > 0) {
        v.setBool(intToBool(intV));
        offset += numBytes;
      } else {
        v.setNull(NullType::BAD_DATA);
      }
      break;
    }
    case PropertyType::STRING: {
      folly::StringPiece strV;
      int32_t numBytes = readString(offset, strV);
      if (numBytes > 0) {
        v.setBool(strToBool(strV));
        offset += numBytes;
      } else {
        v.setNull(NullType::BAD_DATA);
      }
      break;
    }
    default: {
      v.setNull(NullType::BAD_TYPE);
    }
  }
  return v;
}
Value RowReaderV1 :: getBool ( int64_t index ) const noexcept { RR_GET_OFFSET ( ) Value v ; switch ( getSchema ( ) -> getFieldType ( index ) ) { case PropertyType :: BOOL : { v . setBool ( intToBool ( buffer_ [ offset ] ) ) ; offset ++ ; break ; } case PropertyType :: INT64 : { int64_t intV ; int32_t numBytes = readInteger ( offset , intV ) ; if ( numBytes > 0 ) { v . setBool ( intToBool ( intV ) ) ; offset += numBytes ; } else { v . setNull ( NullType :: BAD_DATA ) ; } break ; } case PropertyType :: STRING : { folly :: StringPiece strV ; int32_t numBytes = readString ( offset , strV ) ; if ( numBytes > 0 ) { v . setBool ( strToBool ( strV ) ) ; offset += numBytes ; } else { v . setNull ( NullType :: BAD_DATA ) ; } break ; } default : { v . setNull ( NullType :: BAD_TYPE ) ; } } return v ; }
Get the property value from the serialized binary string
Get the property value from the serialized binary string