Skip to content

Instantly share code, notes, and snippets.

@pitrou
Created August 26, 2020 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pitrou/282dd790cac0eb2c1b59e8c9ab1941d8 to your computer and use it in GitHub Desktop.
Save pitrou/282dd790cac0eb2c1b59e8c9ab1941d8 to your computer and use it in GitHub Desktop.
TEST_F(TestArrowReconstruct, BasicList) {
// Arrow schema: list(bool not null) not null
this->SetParquetSchema(
PrimitiveNode::Make("node_name", Repetition::REPEATED, ParquetType::INT32));
std::vector<int16_t> def_levels = {0, 1, 1, 1};
std::vector<int16_t> rep_levels = {0, 0, 1, 0};
std::vector<int32_t> values = {4, 5, 6};
auto expected = ArrayFromJSON(list(int32()), "[[], [4, 5], [6]]");
ASSERT_OK_AND_ASSIGN(auto actual,
this->Reconstruct<ParquetType::INT32>(def_levels, rep_levels, values));
AssertArrowReconstruct(def_levels, rep_levels, values, expected);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment