| 234 | class TableWriteTest : public HiveConnectorTestBase { |
| 235 | protected: |
| 236 | explicit TableWriteTest(uint64_t testValue) |
| 237 | : testParam_(static_cast<TestParam>(testValue)), |
| 238 | fileFormat_(testParam_.fileFormat()), |
| 239 | testMode_(testParam_.testMode()), |
| 240 | numTableWriterCount_( |
| 241 | testParam_.multiDrivers() ? kNumTableWriterCount : 1), |
| 242 | numPartitionedTableWriterCount_( |
| 243 | testParam_.multiDrivers() ? kNumPartitionedTableWriterCount : 1), |
| 244 | commitStrategy_(testParam_.commitStrategy()), |
| 245 | compressionKind_(testParam_.compressionKind()) { |
| 246 | LOG(INFO) << testParam_.toString(); |
| 247 | |
| 248 | auto rowType = |
| 249 | ROW({"c0", "c1", "c2", "c3", "c4", "c5"}, |
| 250 | {BIGINT(), INTEGER(), SMALLINT(), REAL(), DOUBLE(), VARCHAR()}); |
| 251 | setDataTypes(rowType); |
| 252 | if (testMode_ == TestMode::kPartitioned || |
| 253 | testMode_ == TestMode::kBucketed) { |
| 254 | const std::vector<std::string> partitionBy = {"c0", "c1"}; |
| 255 | setPartitionBy(partitionBy); |
| 256 | numPartitionKeyValues_ = {4, 4}; |
| 257 | } |
| 258 | if (testMode_ == TestMode::kBucketed || |
| 259 | testMode_ == TestMode::kOnlyBucketed) { |
| 260 | std::vector<std::string> bucketedBy = {"c3", "c5"}; |
| 261 | std::vector<TypePtr> bucketedTypes = {REAL(), VARCHAR()}; |
| 262 | std::vector<std::shared_ptr<const HiveSortingColumn>> sortedBy; |
| 263 | if (testParam_.bucketSort()) { |
| 264 | // The sortedBy key shouldn't contain partitionBy key. |
| 265 | sortedBy = {std::make_shared<const HiveSortingColumn>( |
| 266 | "c4", core::SortOrder{true, true})}; |
| 267 | // The sortColumnIndices_ should represent the indices after removing |
| 268 | // the partition keys. |
| 269 | if (testMode_ == TestMode::kBucketed) { |
| 270 | sortColumnIndices_ = {2}; |
| 271 | } else { |
| 272 | sortColumnIndices_ = {4}; |
| 273 | } |
| 274 | |
| 275 | sortedFlags_ = {{true, true}}; |
| 276 | } |
| 277 | bucketProperty_ = std::make_shared<HiveBucketProperty>( |
| 278 | testParam_.bucketKind(), 4, bucketedBy, bucketedTypes, sortedBy); |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | void SetUp() override { |
| 283 | HiveConnectorTestBase::SetUp(); |
nothing calls this directly
no test coverage detected