aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.com>2024-10-16 00:34:37 +0300
committerbabenko <babenko@yandex-team.com>2024-10-16 00:48:40 +0300
commit1b5197fff8ac2009345ea6e150ae6ebe39d5aa5e (patch)
tree71ac4338f526ac4e16271682231df8e81ab5e721
parent7df51c087e50f0756e3c51c7dcbf10392f441d12 (diff)
downloadydb-1b5197fff8ac2009345ea6e150ae6ebe39d5aa5e.tar.gz
Avoid uninitialized fields in TTableUploadOptions
commit_hash:560a4aa2f6f6e37f23c3fefe08f7648e9379c4d8
-rw-r--r--yt/yt/client/table_client/table_upload_options.cpp6
-rw-r--r--yt/yt/client/table_client/table_upload_options.h18
2 files changed, 10 insertions, 14 deletions
diff --git a/yt/yt/client/table_client/table_upload_options.cpp b/yt/yt/client/table_client/table_upload_options.cpp
index 6e3bddcf26..06c4d9c064 100644
--- a/yt/yt/client/table_client/table_upload_options.cpp
+++ b/yt/yt/client/table_client/table_upload_options.cpp
@@ -359,8 +359,6 @@ TTableUploadOptions GetFileUploadOptions(
auto enableStripedErasure = cypressTableAttributes.Get<bool>("enable_striped_erasure", false);
auto erasureCodec = cypressTableAttributes.Get<NErasure::ECodec>("erasure_codec", NErasure::ECodec::None);
- TTableUploadOptions result;
-
if (path.GetAppend()) {
THROW_ERROR_EXCEPTION("Attribute \"append\" is not supported for files")
<< TErrorAttribute("path", path);
@@ -374,13 +372,11 @@ TTableUploadOptions GetFileUploadOptions(
<< TErrorAttribute("path", path);
}
+ TTableUploadOptions result;
result.CompressionCodec = compressionCodec;
result.ErasureCodec = erasureCodec;
result.EnableStripedErasure = enableStripedErasure;
result.SecurityTags = path.GetSecurityTags();
- result.LockMode = ELockMode::Exclusive;
- result.UpdateMode = EUpdateMode::Overwrite;
-
return result;
}
diff --git a/yt/yt/client/table_client/table_upload_options.h b/yt/yt/client/table_client/table_upload_options.h
index 91bfa5fc87..24e19766fd 100644
--- a/yt/yt/client/table_client/table_upload_options.h
+++ b/yt/yt/client/table_client/table_upload_options.h
@@ -50,20 +50,20 @@ private:
struct TTableUploadOptions
{
- NChunkClient::EUpdateMode UpdateMode;
- NCypressClient::ELockMode LockMode;
+ NChunkClient::EUpdateMode UpdateMode = NChunkClient::EUpdateMode::Overwrite;
+ NCypressClient::ELockMode LockMode = NCypressClient::ELockMode::Exclusive;
TEpochSchema TableSchema;
TMasterTableSchemaId SchemaId;
- ETableSchemaModification SchemaModification;
+ ETableSchemaModification SchemaModification = ETableSchemaModification::None;
TVersionedWriteOptions VersionedWriteOptions;
- ETableSchemaMode SchemaMode;
- EOptimizeFor OptimizeFor;
+ ETableSchemaMode SchemaMode = ETableSchemaMode::Strong;
+ EOptimizeFor OptimizeFor = EOptimizeFor::Lookup;
std::optional<NChunkClient::EChunkFormat> ChunkFormat;
- NCompression::ECodec CompressionCodec;
- NErasure::ECodec ErasureCodec;
- bool EnableStripedErasure;
+ NCompression::ECodec CompressionCodec = NCompression::ECodec::None;
+ NErasure::ECodec ErasureCodec = NErasure::ECodec::None;
+ bool EnableStripedErasure = false;
std::optional<std::vector<NSecurityClient::TSecurityTag>> SecurityTags;
- bool PartiallySorted;
+ bool PartiallySorted = false;
TTableSchemaPtr GetUploadSchema() const;