summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruzhas <[email protected]>2022-09-30 23:43:33 +0300
committeruzhas <[email protected]>2022-09-30 23:43:33 +0300
commitd479316c284f478d8bd44dd5eb57d5899b1ded4e (patch)
tree82e412eb5c9c6cedc7b1346598b950555a46bad9
parent6e113cdc262098c7e83fda70b53600c1c201d769 (diff)
support pgdate from json
-rw-r--r--ydb/library/yql/udfs/common/clickhouse/client/clickhouse_client_udf.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ydb/library/yql/udfs/common/clickhouse/client/clickhouse_client_udf.cpp b/ydb/library/yql/udfs/common/clickhouse/client/clickhouse_client_udf.cpp
index 1870e014d40..46508bac7e7 100644
--- a/ydb/library/yql/udfs/common/clickhouse/client/clickhouse_client_udf.cpp
+++ b/ydb/library/yql/udfs/common/clickhouse/client/clickhouse_client_udf.cpp
@@ -335,6 +335,7 @@ TUnboxedValuePod ConvertOutputValueForPgType(const NDB::IColumn* col, const TPgC
if (!ret) {
ythrow yexception() << "Failed to parse value of pg type " << meta.TypeName << ", details: " << TStringBuf(parseError.Data(), parseError.Size());
}
+ return ret.Release();
}
switch (*meta.SourceLogicalSlot) {
@@ -503,7 +504,8 @@ TUnboxedValuePod ConvertOutputValue(const NDB::IColumn* col, const TColumnMeta&
auto size = GetDataTypeInfo(*meta.Slot).FixedSize;
TUnboxedValuePod ret = TUnboxedValuePod::Zero();
Y_ENSURE(ref.size <= 8);
- memcpy(&ret, ref.data, size);
+ Y_ENSURE(ref.size == size);
+ memcpy(&ret, ref.data, ref.size);
if (tzId) {
if (*meta.Slot == EDataSlot::TzDatetime) {
ret.SetTimezoneId(tzId);
@@ -712,7 +714,7 @@ private:
class TStreamValue : public TBoxedValue {
public:
TStreamValue(const std::string& type, const NDB::FormatSettings& settings, const IValueBuilder* valueBuilder, const TUnboxedValue& stream,
- const std::vector<TColumnMeta> outMeta, const NDB::ColumnsWithTypeAndName& columns, ui32 tupleSize, const TSourcePosition& pos, ui32 tzId)
+ const std::vector<TColumnMeta>& outMeta, const NDB::ColumnsWithTypeAndName& columns, ui32 tupleSize, const TSourcePosition& pos, ui32 tzId)
: ValueBuilder(valueBuilder)
, Stream(stream)
, OutMeta(outMeta)