aboutsummaryrefslogtreecommitdiffstats
path: root/yt/yt/client/formats/helpers.h
blob: 526a95db0f6c60ab5e50c8854f20253cb922ffaf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include "public.h"

#include <yt/yt/client/table_client/public.h>

#include <yt/yt/core/yson/consumer.h>
#include <yt/yt/core/yson/parser.h>

namespace NYT::NFormats {

////////////////////////////////////////////////////////////////////////////////

class TFormatsConsumerBase
    : public virtual NYson::IFlushableYsonConsumer
{
public:
    TFormatsConsumerBase();

    // This method has standard implementation for YAMR, DSV and YAMRED DSV formats.
    void OnRaw(TStringBuf yson, NYson::EYsonType type) override;

    void Flush() override;

private:
    NYson::TStatelessYsonParser Parser;
};

////////////////////////////////////////////////////////////////////////////////

void WriteUnversionedValue(const NTableClient::TUnversionedValue& value, IOutputStream* output, const TEscapeTable& escapeTable);

bool IsTrivialIntermediateSchema(const NTableClient::TTableSchema& schema);

////////////////////////////////////////////////////////////////////////////////

} // namespace NYT::NFormats