-
Notifications
You must be signed in to change notification settings - Fork 694
YQ-3010 Check fields count and types in raw format (s3 and pq) #3352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YQ-3010 Check fields count and types in raw format (s3 and pq) #3352
Conversation
⚪ |
⚪
|
⚪
|
⚪ |
⚪
|
⚪
|
const TStructExprType* structRowType = rowType->Cast<TStructExprType>(); | ||
|
||
if (format == "raw"sv && structRowType->GetSize() > 1) { | ||
ctx.AddError(TIssue(ctx.GetPosition(rowTypeNode.Pos()), "Only one field (in schema) supported in raw format")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
давай в ошибку напишем сколько полей мы увидели в схеме. давай скобки уберем из текста. и давай еще проверит тип колонки. такой код уже где-то писался. посмотри в pq провайдере, например
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тип колонки не только String может быть, raw может и в UINT64 преобразовываться
WITH ( format=raw, SCHEMA ( Data UINT64 ) )
.
Похожая проверка есть в s3sink (https://github.com/ydb-platform/ydb/blob/main/ydb/library/yql/providers/s3/provider/yql_s3_datasink_type_ann.cpp#L373), но она не про это.
Остальное поправил.
⚪
|
⚪
|
⚪ |
⚪ |
⚪ |
⚪
|
⚪
|
ctx.AddError(TIssue(TStringBuilder() << "Only one field in schema supported in raw format (you have " | ||
<< realSchemaRowCount << " fields)")); | ||
return false; | ||
} else if (realSchemaRowCount == 1 && rowType != ctx.MakeType<TDataExprType>(EDataSlot::String)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
избыточный else. пиши код линейнее
разрешаем типы string, utf8, json, yson + опциональность
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавил optional + (string, utf8, json, yson)
⚪
|
⚪
|
⚪ |
⚪ |
⚪ |
⚪ |
⚪ |
⚪
|
⚪
|
Changelog entry
...
Changelog category
Additional information
...