Exemple #1
0
// column offset is the actual offset of the column within the tuple slot
common::Value *Tile::GetValueFast(const oid_t tuple_offset, const size_t column_offset,
                                  const common::Type::TypeId column_type, const bool is_inlined) {
    PL_ASSERT(tuple_offset < GetAllocatedTupleCount());
    PL_ASSERT(column_offset < schema.GetLength());

    const char *tuple_location = GetTupleLocation(tuple_offset);
    const char *field_location = tuple_location + column_offset;

    return common::Value::DeserializeFrom(field_location, column_type, is_inlined);
}
Exemple #2
0
// column offset is the actual offset of the column within the tuple slot
Value Tile::GetValueFast(const oid_t tuple_offset, const size_t column_offset,
                         const ValueType column_type, const bool is_inlined) {
  assert(tuple_offset < GetAllocatedTupleCount());
  assert(column_offset < schema.GetLength());

  const char *tuple_location = GetTupleLocation(tuple_offset);
  const char *field_location = tuple_location + column_offset;

  return Value::InitFromTupleStorage(field_location, column_type, is_inlined);
}
Exemple #3
0
// column id is a 0-based column number
common::Value *Tile::GetValue(const oid_t tuple_offset, const oid_t column_id) {
    PL_ASSERT(tuple_offset < GetAllocatedTupleCount());
    PL_ASSERT(column_id < schema.GetColumnCount());

    const common::Type::TypeId column_type = schema.GetType(column_id);

    const char *tuple_location = GetTupleLocation(tuple_offset);
    const char *field_location = tuple_location + schema.GetOffset(column_id);
    const bool is_inlined = schema.IsInlined(column_id);

    return common::Value::DeserializeFrom(field_location, column_type, is_inlined);
}
Exemple #4
0
// column id is a 0-based column number
Value Tile::GetValue(const oid_t tuple_offset, const oid_t column_id) {
  assert(tuple_offset < GetAllocatedTupleCount());
  assert(column_id < schema.GetColumnCount());

  const ValueType column_type = schema.GetType(column_id);

  const char *tuple_location = GetTupleLocation(tuple_offset);
  const char *field_location = tuple_location + schema.GetOffset(column_id);
  const bool is_inlined = schema.IsInlined(column_id);

  return Value::InitFromTupleStorage(field_location, column_type, is_inlined);
}
// column offset is the actual offset of the column within the tuple slot
void Tile::SetValueFast(const type::Value &value, const oid_t tuple_offset,
                        const size_t column_offset, const bool is_inlined,
                        UNUSED_ATTRIBUTE const size_t column_length) {
  PL_ASSERT(tuple_offset < num_tuple_slots);
  PL_ASSERT(column_offset < schema.GetLength());

  char *tuple_location = GetTupleLocation(tuple_offset);
  char *field_location = tuple_location + column_offset;

  // const bool is_in_bytes = false;
  PL_ASSERT(pool != nullptr);
  value.SerializeTo(field_location, is_inlined, pool);
}
Exemple #6
0
// column offset is the actual offset of the column within the tuple slot
void Tile::SetValueFast(const Value &value, const oid_t tuple_offset,
                        const size_t column_offset, const bool is_inlined,
                        const size_t column_length) {
  assert(tuple_offset < num_tuple_slots);
  assert(column_offset < schema.GetLength());

  char *tuple_location = GetTupleLocation(tuple_offset);
  char *field_location = tuple_location + column_offset;

  const bool is_in_bytes = false;
  value.SerializeToTupleStorageAllocateForObjects(
      field_location, is_inlined, column_length, is_in_bytes, pool);
}
// column id is a 0-based column number
void Tile::SetValue(const type::Value &value, const oid_t tuple_offset,
                    const oid_t column_id) {
  PL_ASSERT(tuple_offset < num_tuple_slots);
  PL_ASSERT(column_id < schema.GetColumnCount());

  char *tuple_location = GetTupleLocation(tuple_offset);
  char *field_location = tuple_location + schema.GetOffset(column_id);
  const bool is_inlined = schema.IsInlined(column_id);
  // size_t column_length = schema.GetAppropriateLength(column_id);

  // const bool is_in_bytes = false;
  PL_ASSERT(pool != nullptr);
  value.SerializeTo(field_location, is_inlined, pool);
}
Exemple #8
0
// column id is a 0-based column number
void Tile::SetValue(const Value &value, const oid_t tuple_offset,
                    const oid_t column_id) {
  assert(tuple_offset < num_tuple_slots);
  assert(column_id < schema.GetColumnCount());

  char *tuple_location = GetTupleLocation(tuple_offset);
  char *field_location = tuple_location + schema.GetOffset(column_id);
  const bool is_inlined = schema.IsInlined(column_id);
  size_t column_length = schema.GetAppropriateLength(column_id);

  const bool is_in_bytes = false;
  value.SerializeToTupleStorageAllocateForObjects(
      field_location, is_inlined, column_length, is_in_bytes, pool);
}
/**
 * Loads only tuple data and assumes there is no schema present.
 * Used for recovery where the schema is not sent.
 * @param allow_export if false, export enabled is overriden for this load.
 */
void Tile::DeserializeTuplesFromWithoutHeader(SerializeInput &input,
                                              type::AbstractPool *pool) {
  oid_t tuple_count = input.ReadInt();
  PL_ASSERT(tuple_count > 0);

  // First, check if we have required space
  PL_ASSERT(tuple_count <= num_tuple_slots);
  storage::Tuple *temp_tuple = new storage::Tuple(&schema, true);

  for (oid_t tuple_itr = 0; tuple_itr < tuple_count; ++tuple_itr) {
    temp_tuple->Move(GetTupleLocation(tuple_itr));
    temp_tuple->DeserializeFrom(input, pool);
    // TRACE("Loaded new tuple #%02d\n%s", tuple_itr,
    // temp_target1.debug(Name()).c_str());
  }
}