설명
Parquet file 메타데이터를 읽기 위한 특수 포맷입니다(https://parquet.apache.org/docs/file-format/metadata/). 항상 다음 구조/내용으로 1개의 행을 출력합니다.
num_columns- 컬럼 수- ``num_rows` - 전체 행 수
num_row_groups- 전체 row group 수format_version- Parquet 포맷 버전으로, 항상 1.0 또는 2.6입니다total_uncompressed_size- 데이터의 전체 비압축 바이트 크기이며, 모든 row group의 total_byte_size 합으로 계산됩니다total_compressed_size- 데이터의 전체 압축 바이트 크기이며, 모든 row group의 total_compressed_size 합으로 계산됩니다columns- 다음 구조를 가진 컬럼 메타데이터 목록:name- 컬럼 이름path- 컬럼 경로(Nested컬럼의 경우name과 다름)max_definition_level- 최대 definition levelmax_repetition_level- 최대 repetition levelphysical_type- 컬럼 물리 타입logical_type- 컬럼 논리 타입compression- 이 컬럼에 사용된 압축 방식total_uncompressed_size- 컬럼의 전체 비압축 바이트 크기이며, 모든 row group에서 해당 컬럼의 total_uncompressed_size 합으로 계산됩니다total_compressed_size- 컬럼의 전체 압축 바이트 크기이며, 모든 row group에서 해당 컬럼의 total_compressed_size 합으로 계산됩니다space_saved- 압축으로 절약된 공간의 비율이며, (1 - total_compressed_size/total_uncompressed_size)로 계산됩니다.encodings- 이 컬럼에 사용된 인코딩 목록
row_groups- 다음 구조를 가진 row group 메타데이터 목록:num_columns- row group의 컬럼 수num_rows- row group의 행 수total_uncompressed_size- row group의 전체 비압축 바이트 크기total_compressed_size- row group의 전체 압축 바이트 크기columns- 다음 구조를 가진 컬럼 청크 메타데이터 목록:name- 컬럼 이름path- 컬럼 경로total_compressed_size- 컬럼의 전체 압축 바이트 크기total_uncompressed_size- row group의 전체 비압축 바이트 크기have_statistics- 컬럼 청크 메타데이터에 column statistics가 포함되어 있는지를 나타내는 불리언 flagstatistics- 컬럼 청크 통계(have_statistics = false이면 모든 필드가 NULL)로, 다음 구조를 가집니다:num_values- 컬럼 청크에서 non-NULL 값의 수null_count- 컬럼 청크에서 NULL 값의 수distinct_count- 컬럼 청크에서 고유값 수min- 컬럼 청크의 최솟값max- 컬럼 청크의 최댓값
사용 예시
예시:
SELECT *
FROM file(data.parquet, ParquetMetadata)
FORMAT PrettyJSONEachRow{
"num_columns": "2",
"num_rows": "100000",
"num_row_groups": "2",
"format_version": "2.6",
"metadata_size": "577",
"total_uncompressed_size": "282436",
"total_compressed_size": "26633",
"columns": [
{
"name": "number",
"path": "number",
"max_definition_level": "0",
"max_repetition_level": "0",
"physical_type": "INT32",
"logical_type": "Int(bitWidth=16, isSigned=false)",
"compression": "LZ4",
"total_uncompressed_size": "133321",
"total_compressed_size": "13293",
"space_saved": "90.03%",
"encodings": [
"RLE_DICTIONARY",
"PLAIN",
"RLE"
]
},
{
"name": "concat('Hello', toString(modulo(number, 1000)))",
"path": "concat('Hello', toString(modulo(number, 1000)))",
"max_definition_level": "0",
"max_repetition_level": "0",
"physical_type": "BYTE_ARRAY",
"logical_type": "None",
"compression": "LZ4",
"total_uncompressed_size": "149115",
"total_compressed_size": "13340",
"space_saved": "91.05%",
"encodings": [
"RLE_DICTIONARY",
"PLAIN",
"RLE"
]
}
],
"row_groups": [
{
"num_columns": "2",
"num_rows": "65409",
"total_uncompressed_size": "179809",
"total_compressed_size": "14163",
"columns": [
{
"name": "number",
"path": "number",
"total_compressed_size": "7070",
"total_uncompressed_size": "85956",
"have_statistics": true,
"statistics": {
"num_values": "65409",
"null_count": "0",
"distinct_count": null,
"min": "0",
"max": "999"
}
},
{
"name": "concat('Hello', toString(modulo(number, 1000)))",
"path": "concat('Hello', toString(modulo(number, 1000)))",
"total_compressed_size": "7093",
"total_uncompressed_size": "93853",
"have_statistics": true,
"statistics": {
"num_values": "65409",
"null_count": "0",
"distinct_count": null,
"min": "Hello0",
"max": "Hello999"
}
}
]
},
...
]
}