-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added possibility to easily identify schema root in Parquet Schema (#627
- Loading branch information
1 parent
427b0b5
commit b9c4e63
Showing
6 changed files
with
125 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/NestedColumnTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Flow\Parquet\Tests\Unit\ParquetFile\Schema; | ||
|
||
use Flow\Parquet\ParquetFile\Schema; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class NestedColumnTest extends TestCase | ||
{ | ||
public function test_children_flat() : void | ||
{ | ||
$column = Schema\NestedColumn::create('nested', [ | ||
Schema\NestedColumn::create('nested', [ | ||
Schema\NestedColumn::create('nested', [ | ||
Schema\FlatColumn::int32('int'), | ||
Schema\FlatColumn::string('string'), | ||
Schema\FlatColumn::boolean('bool'), | ||
]), | ||
]), | ||
]); | ||
|
||
$this->assertSame( | ||
[ | ||
'nested.nested.nested.int', | ||
'nested.nested.nested.string', | ||
'nested.nested.nested.bool', | ||
], | ||
\array_keys($column->childrenFlat()) | ||
); | ||
} | ||
|
||
public function test_flat_path_for_direct_root_child() : void | ||
{ | ||
$schema = Schema::with( | ||
Schema\FlatColumn::int32('int'), | ||
Schema\FlatColumn::string('string'), | ||
Schema\FlatColumn::boolean('bool'), | ||
); | ||
|
||
$this->assertSame('int', $schema->get('int')->flatPath()); | ||
$this->assertSame('string', $schema->get('string')->flatPath()); | ||
$this->assertSame('bool', $schema->get('bool')->flatPath()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters