MCPcopy Create free account
hub / github.com/catboost/catboost / ProcessColumnAfterIndex

Function ProcessColumnAfterIndex

catboost/libs/column_description/cd_parser.cpp:27–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 }
26
27 void ProcessColumnAfterIndex(
28 TStringBuf srcDescription,
29 const TColumn& defaultColumn,
30 size_t index,
31 TArrayRef<TString> tokens,
32 TVector<TColumn>* columns,
33 TSet<size_t>* parsedColumns
34 ) {
35 CB_ENSURE(!parsedColumns->contains(index), "column specified twice in " << srcDescription << ": " << index);
36 parsedColumns->insert(index);
37
38 columns->resize(Max(columns->size(), index + 1), defaultColumn);
39
40 TStringBuf type = ToCanonicalColumnName(tokens[1]);
41 CB_ENSURE(TryFromString<EColumn>(type, (*columns)[index].Type), "unsupported column type " << type);
42
43 if (tokens.ysize() == 3) {
44 (*columns)[index].Id = tokens[2];
45 }
46 }
47
48
49 template <class TReadLineFunc>

Callers 1

ReadCDImplFunction · 0.85

Calls 7

ToCanonicalColumnNameFunction · 0.85
MaxFunction · 0.50
containsMethod · 0.45
insertMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
ysizeMethod · 0.45

Tested by

no test coverage detected