C++ YT Wrapper
C++ library for working with YT clusters
Loading...
Searching...
No Matches
NYT::TTableSchema Class Reference

Description of table schema. More...

#include <common.h>

Public Member Functions

 FLUENT_VECTOR_FIELD_ENCAPSULATED (TColumnSchema, Column)
 Column schema.
 FLUENT_FIELD_DEFAULT_ENCAPSULATED (bool, Strict, true)
 Strictness of the schema.
 FLUENT_FIELD_DEFAULT_ENCAPSULATED (bool, UniqueKeys, false)
 Whether keys are unique.
 FLUENT_VECTOR_FIELD_ENCAPSULATED (TDeletedColumnSchema, DeletedColumn)
 Deleted column schema.
TVector< TColumnSchema > & MutableColumns ()
 Get modifiable column list.
bool Empty () const
 Check if schema has any described column.
TTableSchema & AddColumn (const TString &name, const NTi::TTypePtr &type, ESortOrder sortOrder) &
 Add column.
TTableSchema AddColumn (const TString &name, const NTi::TTypePtr &type, ESortOrder sortOrder) &&
 Add column.
TTableSchema & AddColumn (const TString &name, const NTi::TTypePtr &type) &
 Add column.
TTableSchema AddColumn (const TString &name, const NTi::TTypePtr &type) &&
 Add column.
TTableSchema & AddColumn (const TString &name, EValueType type, ESortOrder sortOrder) &
 Add optional column of specified type.
TTableSchema AddColumn (const TString &name, EValueType type, ESortOrder sortOrder) &&
 Add optional column of specified type.
TTableSchema & AddColumn (const TString &name, EValueType type) &
 Add optional column of specified type.
TTableSchema AddColumn (const TString &name, EValueType type) &&
 Add optional column of specified type.
TTableSchema & SortBy (const TSortColumns &columns) &
 Make table schema sorted by specified columns.
TTableSchema SortBy (const TSortColumns &columns) &&
 Make table schema sorted by specified columns.
TNode ToNode () const
 Get yson description of table schema.

Static Public Member Functions

static NYT::TTableSchema FromNode (const TNode &node)
 Parse schema from yson node.

Friends

void Deserialize (TTableSchema &tableSchema, const TNode &node)

Detailed Description

Member Function Documentation

◆ AddColumn() [1/6]

TTableSchema & NYT::TTableSchema::AddColumn ( const TString & name,
const NTi::TTypePtr & type ) &

Add column.

◆ AddColumn() [2/6]

TTableSchema NYT::TTableSchema::AddColumn ( const TString & name,
const NTi::TTypePtr & type ) &&

Add column.

◆ AddColumn() [3/6]

TTableSchema NYT::TTableSchema::AddColumn ( const TString & name,
const NTi::TTypePtr & type,
ESortOrder sortOrder ) &&

Add column.

◆ AddColumn() [4/6]

TTableSchema & NYT::TTableSchema::AddColumn ( const TString & name,
EValueType type ) &

Add optional column of specified type.

◆ AddColumn() [5/6]

TTableSchema NYT::TTableSchema::AddColumn ( const TString & name,
EValueType type ) &&

Add optional column of specified type.

◆ AddColumn() [6/6]

TTableSchema NYT::TTableSchema::AddColumn ( const TString & name,
EValueType type,
ESortOrder sortOrder ) &&

Add optional column of specified type.

◆ FLUENT_FIELD_DEFAULT_ENCAPSULATED() [1/2]

NYT::TTableSchema::FLUENT_FIELD_DEFAULT_ENCAPSULATED ( bool ,
Strict ,
true  )

Strictness of the schema.

Strict schemas are not allowed to have columns not described in schema. Nonstrict schemas are allowed to have such columns, all such missing columns are assumed to have type any (or optional<yson> in type_v3 terminology).

◆ FLUENT_FIELD_DEFAULT_ENCAPSULATED() [2/2]

NYT::TTableSchema::FLUENT_FIELD_DEFAULT_ENCAPSULATED ( bool ,
UniqueKeys ,
false  )

Whether keys are unique.

This flag can be set only for schemas that have sorted columns. If flag is set table cannot have multiple rows with same key.

◆ SortBy() [1/2]

TTableSchema & NYT::TTableSchema::SortBy ( const TSortColumns & columns) &

Make table schema sorted by specified columns.

Resets old key columns if any

◆ SortBy() [2/2]

TTableSchema NYT::TTableSchema::SortBy ( const TSortColumns & columns) &&

Make table schema sorted by specified columns.

Resets old key columns if any


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