Passed
Pull Request — master (#38)
by Teye
05:25
created

ParquetInputFormat   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A toArray() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Level23\Druid\InputFormats;
5
6
class ParquetInputFormat extends OrcInputFormat
7
{
8
    /**
9
     * @param FlattenSpec|null $flattenSpec    Define a flattenSpec to extract nested values from a Parquet file. Note
10
     *                                         that only 'path' expression are supported ('jq' is unavailable).
11
     * @param bool|null        $binaryAsString Specifies if the bytes parquet column which is not logically marked as a
12
     *                                         string or enum type should be treated as a UTF-8 encoded string.
13
     */
14 1
    public function __construct(FlattenSpec $flattenSpec = null, bool $binaryAsString = null)
15
    {
16 1
        parent::__construct($flattenSpec, $binaryAsString);
17
    }
18
19
    /**
20
     * Return the ParquetInputFormat so that it can be used in a druid query.
21
     *
22
     * @return array<string,string|array<string,bool|array<array<string,string>>>|bool>
23
     */
24 1
    public function toArray(): array
25
    {
26 1
        $result         = parent::toArray();
27 1
        $result['type'] = 'parquet';
28
29 1
        return $result;
30
    }
31
}