Skip to content

Commit

Permalink
feat: Table evolution fuzzer (#116)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #116

X-link: facebookincubator/velox#11872

Basic version of table evolution fuzzer.  Full design of the fuzzer can be found at https://docs.google.com/document/d/18jjNRknSxI99mgdL7eDMzkq65i-mi47Ukymi3JkXzUA/edit

Reviewed By: xiaoxmeng

Differential Revision: D67283632

fbshipit-source-id: c41ac3cfde75eec68ec86a5fa43936cd2bcd608b
  • Loading branch information
Yuhta authored and facebook-github-bot committed Dec 18, 2024
1 parent 3b70f92 commit 8ddc37c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dwio/nimble/velox/tests/VeloxReaderTests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Meta Platforms, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -82,6 +82,8 @@ struct VeloxMapGeneratorConfig {
// If true, generated string field will have variable length, maxing at
// 'stringLength'.
bool stringVariableLength = true;

bool allowConstant = true;
};

// Generates a RowVector containing a set of feature MapVector with
Expand Down Expand Up @@ -140,6 +142,7 @@ class VeloxMapGenerator {
.stringVariableLength = config_.stringVariableLength,
.containerLength = 5,
.containerVariableLength = true,
.allowConstantVector = config_.allowConstant,
},
leafPool_,
config_.seed);
Expand Down Expand Up @@ -3506,7 +3509,7 @@ TEST_F(VeloxReaderTests, MapToFlatMapAndPassthrough) {
<< "Expected: " << type->toString()
<< ", actual: " << flatRootTypeFromSchema->toString();

// fullReadResult and nextExpected are interchangable at this point
// fullReadResult and nextExpected are interchangeable at this point
for (auto i = 0; i < fullReadResult.size(); ++i) {
velox::VectorPtr flatResult;
auto& current = fullReadResult.at(i);
Expand Down Expand Up @@ -5681,6 +5684,7 @@ TEST_F(VeloxReaderTests, EstimatedRowSizeComplex) {
// BaseVector::retainedSize()
.stringLength = velox::StringView::kInlineSize,
.stringVariableLength = false,
.allowConstant = false,
};
VeloxMapGenerator generator(leafPool_.get(), generatorConfig);
auto vector = generator.generateBatch(rowCount);
Expand Down

0 comments on commit 8ddc37c

Please sign in to comment.