Skip to content

Commit

Permalink
Add 'constraints' to s3 bindings (ydb-platform#4849)
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius authored May 24, 2024
1 parent ee6a5b9 commit 665c03b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,14 @@ class TS3DataSourceTypeAnnotationTransformer : public TVisitorTransformerBase {
return true;
}

if (name == "constraints"sv) {
TStringBuf unused;
if (!ExtractSettingValue(setting.Tail(), "constraints"sv, format, {}, ctx, unused)) {
return false;
}
return true;
}

YQL_ENSURE(name == "projection"sv);
haveProjection = true;
if (!EnsureAtom(setting.Tail(), ctx)) {
Expand All @@ -721,7 +729,7 @@ class TS3DataSourceTypeAnnotationTransformer : public TVisitorTransformerBase {
return true;
};
if (!EnsureValidSettings(*input->Child(TS3Object::idx_Settings),
{ "compression"sv, "partitionedby"sv, "projection"sv, "data.interval.unit"sv,
{ "compression"sv, "partitionedby"sv, "projection"sv, "data.interval.unit"sv, "constraints"sv,
"data.datetime.formatname"sv, "data.datetime.format"sv, "data.timestamp.formatname"sv, "data.timestamp.format"sv,
"readmaxbytes"sv, "csvdelimiter"sv, "directories"sv, "filepattern"sv, "pathpattern"sv, "pathpatternvariant"sv }, validator, ctx))
{
Expand Down
2 changes: 2 additions & 0 deletions ydb/library/yql/utils/bindings/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ void LoadBindings(THashMap<TString, NSQLTranslation::TTableBindingSettings>& dst
binding.ClusterType = v.GetString();
} else if (k == "schema") {
binding.Settings["schema"] = SerializeJsonValueAsYsonText(v);
} else if (k == "constraints") {
binding.Settings["constraints"] = SerializeJsonValueAsYsonText(v);
} else {
YQL_ENSURE(v.IsString());
binding.Settings.emplace(k, v.GetString());
Expand Down

0 comments on commit 665c03b

Please sign in to comment.