Public Member Functions
ibis::bord::part Class Reference

An in-memory data partition. More...

#include <bord110517.h>

Inheritance diagram for ibis::bord::part:
ibis::part

List of all members.

Public Member Functions

int backup (const char *, const char *, const char *) const
 Write the content of partition into the specified directory dir.
void describe (std::ostream &) const
int dump (std::ostream &, uint32_t, const char *) const
 Print the first nr rows of the data to the given output stream.
int dump (std::ostream &, uint32_t, uint32_t, const char *) const
 Print nr rows starting with row offset.
void dumpNames (std::ostream &, const char *) const
ibis::tableevaluateTerms (const ibis::selectClause &, const char *) const
ibis::tablegroupby (const ibis::selectClause &) const
 The actual function to perform the group by operation.
int limit (uint32_t)
 part (const char *tn, const char *td, uint64_t nr, const ibis::table::stringList &cn, const ibis::table::typeList &ct, ibis::table::bufferList &buf, const ibis::table::stringList *cdesc=0)
 Constructor.
virtual long reorder (const ibis::table::stringList &)
 Sort rows according the values of the columns specified in names.
virtual long reorder ()
 Sort rows with the lowest cardinality column first.
long reorderStrings (std::vector< std::string > &vals, const array_t< uint32_t > &ind) const
 Reorder the vector of strings.
template<typename T >
long reorderValues (array_t< T > &vals, const array_t< uint32_t > &ind) const
int restoreCategoriesAsStrings (const ibis::part &, const char *)
 Convert the integer representation to string representation.
void reverseRows ()
long sortStrings (std::vector< std::string > &vals, const array_t< uint32_t > &idxin, array_t< uint32_t > &idxout, array_t< uint32_t > &starts) const
 Sort the string values.
template<typename T >
long sortValues (array_t< T > &vals, const array_t< uint32_t > &indin, array_t< uint32_t > &indout, array_t< uint32_t > &starts) const

Detailed Description

An in-memory data partition.


Constructor & Destructor Documentation

ibis::bord::part::part ( const char *  tn,
const char *  td,
uint64_t  nr,
const ibis::table::stringList cn,
const ibis::table::typeList ct,
ibis::table::bufferList buf,
const ibis::table::stringList cdesc = 0 
)

Constructor.

This object can only store upto 4 billion rows because it uses a 32-bit unsigned integer to store the number of rows.

Note:
The new object will take ownership of the arrays listed in buf. All pointers in buf will be set to nil afterwards.

References ibis::part::amask, ibis::part::colorder, ibis::part::columns, ibis::table::freeBuffer(), ibis::gVerbose, ibis::part::m_desc, ibis::part::m_name, ibis::column::name(), ibis::part::nEvents, ibis::bitvector::set(), ibis::array_t< T >::size(), and ibis::util::strnewdup().


Member Function Documentation

int ibis::bord::part::backup ( const char *  dir,
const char *  tname,
const char *  tdesc 
) const
int ibis::bord::part::dump ( std::ostream &  out,
uint32_t  nr,
const char *  del 
) const

Print the first nr rows of the data to the given output stream.

The return values:

   0  -- normal (successful) completion
  -1  -- no data in-memory
  -2  -- unknown data type
  -3  -- some columns not ibis::bord::column (not in-memory)
  -4  -- error in the output stream

References ibis::part::colorder, ibis::part::columns, ibis::bord::dump(), ibis::column::name(), and ibis::part::nEvents.

int ibis::bord::part::dump ( std::ostream &  out,
uint32_t  offset,
uint32_t  nr,
const char *  del 
) const

Print nr rows starting with row offset.

Note that the row number starts with 0, i.e., the first row is row 0.

References ibis::part::colorder, ibis::part::columns, ibis::bord::dump(), ibis::column::name(), and ibis::part::nEvents.

ibis::table * ibis::bord::part::groupby ( const ibis::selectClause sel) const
virtual long ibis::bord::part::reorder ( ) [inline, virtual]

Sort rows with the lowest cardinality column first.

The lowest cardinality column is ordered first. Only integer-valued columns are used in sorting. Returns the number of rows reordered when successful, otherwise return a negative number and the base data is corrupt!

Warning:
Danger: This function does not update null masks!

Reimplemented from ibis::part.

References ibis::util::reorder().

long ibis::bord::part::reorderStrings ( std::vector< std::string > &  vals,
const array_t< uint32_t > &  ind 
) const

Reorder the vector of strings.

To avoid recreating the content of the string values, this function uses swap operations to move the existing strings into their new locations. It only works if ind is a proper permutation of integers between 0 and vals.size() (include 0 but exclude vals.size()), however, it does not check whether the input array is a proper permutation.

References ibis::gVerbose, ibis::part::nEvents, and ibis::array_t< T >::size().

long ibis::bord::part::sortStrings ( std::vector< std::string > &  vals,
const array_t< uint32_t > &  idxin,
array_t< uint32_t > &  idxout,
array_t< uint32_t > &  starts 
) const

The documentation for this class was generated from the following files:

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive