Passed
Pull Request — master (#38)
by Teye
06:17
created

ParquetInputFormat::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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
}