cpp/src/io/orc/orc.cpp
/**
 * @brief Add a single rowIndexEntry, negative input values treated as not present
 */
@brief Add a single rowIndexEntry, negative input values treated as not present
@brief Add a single rowIndexEntry negative input values treated as not present
void ProtobufWriter::put_row_index_entry(int32_t present_blk,
                                         int32_t present_ofs,
                                         int32_t data_blk,
                                         int32_t data_ofs,
                                         int32_t data2_blk,
                                         int32_t data2_ofs,
                                         TypeKind kind,
                                         ColStatsBlob const* stats)
{
  size_t sz = 0, lpos;
  put_uint(encode_field_number(1, ProtofType::FIXEDLEN));  
  lpos = m_buf->size();
  put_byte(0xcd);                                          
  put_uint(encode_field_number(1, ProtofType::FIXEDLEN));  
  put_byte(0xcd);                                          
  if (present_blk >= 0) sz += put_uint(present_blk);
  if (present_ofs >= 0) {
    sz += put_uint(present_ofs);
    sz += put_byte(0);  
    sz += put_byte(0);  
  }
  if (data_blk >= 0) { sz += put_uint(data_blk); }
  if (data_ofs >= 0) {
    sz += put_uint(data_ofs);
    if (kind != STRING && kind != FLOAT && kind != DOUBLE && kind != DECIMAL) {
      sz += put_byte(0);
      if (kind == BOOLEAN) {
        sz += put_byte(0);
      }
    }
  }
  if (kind != INT) {
    if (data2_blk >= 0) { sz += put_uint(data2_blk); }
    if (data2_ofs >= 0) {
      sz += put_uint(data2_ofs);
      sz += put_byte(0);
    }
  }
  m_buf->data()[lpos + 2] = (uint8_t)(sz);
  if (stats != nullptr) {
    sz += put_uint(encode_field_number<decltype(*stats)>(2));  
    sz += put_uint(stats->size());
    sz += put_bytes<typename ColStatsBlob::value_type>(*stats);
  }
  m_buf->data()[lpos] = (uint8_t)(sz + 2);
}
void ProtobufWriter :: put_row_index_entry ( int32_t present_blk , int32_t present_ofs , int32_t data_blk , int32_t data_ofs , int32_t data2_blk , int32_t data2_ofs , TypeKind kind , ColStatsBlob const * stats ) { size_t sz = 0 , lpos ; put_uint ( encode_field_number ( 1 , ProtofType :: FIXEDLEN ) ) ; lpos = m_buf -> size ( ) ; put_byte ( 0xcd ) ; put_uint ( encode_field_number ( 1 , ProtofType :: FIXEDLEN ) ) ; put_byte ( 0xcd ) ; if ( present_blk >= 0 ) sz += put_uint ( present_blk ) ; if ( present_ofs >= 0 ) { sz += put_uint ( present_ofs ) ; sz += put_byte ( 0 ) ; sz += put_byte ( 0 ) ; } if ( data_blk >= 0 ) { sz += put_uint ( data_blk ) ; } if ( data_ofs >= 0 ) { sz += put_uint ( data_ofs ) ; if ( kind != STRING && kind != FLOAT && kind != DOUBLE && kind != DECIMAL ) { sz += put_byte ( 0 ) ; if ( kind == BOOLEAN ) { sz += put_byte ( 0 ) ; } } } if ( kind != INT ) { if ( data2_blk >= 0 ) { sz += put_uint ( data2_blk ) ; } if ( data2_ofs >= 0 ) { sz += put_uint ( data2_ofs ) ; sz += put_byte ( 0 ) ; } } m_buf -> data ( ) [ lpos + 2 ] = ( uint8_t ) ( sz ) ; if ( stats != nullptr ) { sz += put_uint ( encode_field_number < decltype ( * stats ) > ( 2 ) ) ; sz += put_uint ( stats -> size ( ) ) ; sz += put_bytes < typename ColStatsBlob :: value_type > ( * stats ) ; } m_buf -> data ( ) [ lpos ] = ( uint8_t ) ( sz + 2 ) ; }
@brief Add a single rowIndexEntry, negative input values treated as not present
@brief Add a single rowIndexEntry negative input values treated as not present
// 1:RowIndex.entry // sz+2 // 1:positions[packed=true] // sz // run pos = 0 // bit pos = 0 // RLE run pos always zero (assumes RLE aligned with row index boundaries) // bit position in byte, always zero // INT kind can be passed in to bypass 2nd stream index (dictionary length streams) // RLE run pos always zero (assumes RLE aligned with row index boundaries) // size of the field 1 // 2: statistics // Statistics field contains its length as varint and dtype specific data (encoded on the GPU) // size of the whole row index entry