codec.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include <yql/essentials/public/udf/udf_value.h>
  3. #include <util/generic/strbuf.h>
  4. #include <util/generic/string.h>
  5. namespace NKikimr {
  6. namespace NMiniKQL {
  7. class TPgType;
  8. } // NMiniKQL
  9. } // NKikimr
  10. namespace NYql {
  11. namespace NResult {
  12. class TYsonResultWriter;
  13. }
  14. namespace NCommon {
  15. class TInputBuf;
  16. class TOutputBuf;
  17. TString PgValueToString(const NUdf::TUnboxedValuePod& value, ui32 pgTypeId);
  18. NUdf::TUnboxedValue PgValueFromString(const TStringBuf text, ui32 pgTypeId);
  19. TString PgValueToNativeText(const NUdf::TUnboxedValuePod& value, ui32 pgTypeId);
  20. NUdf::TUnboxedValue PgValueFromNativeText(const TStringBuf text, ui32 pgTypeId);
  21. TString PgValueToNativeBinary(const NUdf::TUnboxedValuePod& value, ui32 pgTypeId);
  22. NUdf::TUnboxedValue PgValueFromNativeBinary(const TStringBuf binary, ui32 pgTypeId);
  23. TString PgValueCoerce(const NUdf::TUnboxedValuePod& value, ui32 pgTypeId, i32 typMod, TMaybe<TString>* error);
  24. void WriteYsonValuePg(NResult::TYsonResultWriter& writer, const NUdf::TUnboxedValuePod& value, NKikimr::NMiniKQL::TPgType* type,
  25. const TVector<ui32>* structPositions);
  26. void WriteYsonValueInTableFormatPg(TOutputBuf& buf, NKikimr::NMiniKQL::TPgType* type, const NKikimr::NUdf::TUnboxedValuePod& value, bool topLevel);
  27. NUdf::TUnboxedValue ReadYsonValueInTableFormatPg(NKikimr::NMiniKQL::TPgType* type, char cmd, TInputBuf& buf);
  28. NUdf::TUnboxedValue ReadYsonValuePg(NKikimr::NMiniKQL::TPgType* type, char cmd, TInputBuf& buf);
  29. void SkipSkiffPg(NKikimr::NMiniKQL::TPgType* type, TInputBuf& buf);
  30. NKikimr::NUdf::TUnboxedValue ReadSkiffPg(NKikimr::NMiniKQL::TPgType* type, TInputBuf& buf);
  31. void WriteSkiffPg(NKikimr::NMiniKQL::TPgType* type, const NKikimr::NUdf::TUnboxedValuePod& value, TOutputBuf& buf);
  32. extern "C" void ReadSkiffPgValue(NKikimr::NMiniKQL::TPgType* type, NKikimr::NUdf::TUnboxedValue& value, TInputBuf& buf);
  33. extern "C" void WriteSkiffPgValue(NKikimr::NMiniKQL::TPgType* type, const NKikimr::NUdf::TUnboxedValuePod& value, TOutputBuf& buf);
  34. } // namespace NCommon
  35. } // namespace NYql