| Total Complexity | 3 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | class ProtobufInputFormat implements InputFormatInterface |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var array<string,string> |
||
| 10 | */ |
||
| 11 | protected array $protoBytesDecoder; |
||
| 12 | |||
| 13 | protected ?FlattenSpec $flattenSpec; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * |
||
| 17 | * @param array<string,string> $protoBytesDecoder Specifies how to decode bytes to Protobuf record. See below for |
||
| 18 | * an example. |
||
| 19 | * @param FlattenSpec|null $flattenSpec Define a flattenSpec to extract nested values from a Parquet |
||
| 20 | * file. Note that only 'path' expression are supported ('jq' is |
||
| 21 | * unavailable). |
||
| 22 | * |
||
| 23 | * Example $protoBytesDecoder value: |
||
| 24 | * ``` |
||
| 25 | * [ |
||
| 26 | * "type" => "file", |
||
| 27 | * "descriptor" => "file:///tmp/metrics.desc", |
||
| 28 | * "protoMessageType" => "Metrics" |
||
| 29 | * ] |
||
| 30 | * ``` |
||
| 31 | * |
||
| 32 | * @see https://druid.apache.org/docs/latest/ingestion/data-formats.html#protobuf |
||
| 33 | */ |
||
| 34 | 1 | public function __construct(array $protoBytesDecoder, FlattenSpec $flattenSpec = null) |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Return the ProtobufInputFormat so that it can be used in a druid query. |
||
| 42 | * |
||
| 43 | * @return array<string,string|array<string,bool|array<array<string,string>>>|string[]> |
||
| 44 | */ |
||
| 45 | 1 | public function toArray(): array |
|
| 57 | } |
||
| 58 | } |