mirror of
https://github.com/asadbek064/hyparquet.git
synced 2026-01-04 18:46:37 +00:00
Fix string conversion with a dictionary
This commit is contained in:
parent
18fa4ac936
commit
07f3a55695
@ -119,6 +119,7 @@ export function readColumn(arrayBuffer, rowGroup, columnMetadata, schema) {
|
||||
for (let i = 0; i < dataPage.length; i++) {
|
||||
values[i] = dictionary[dataPage[i]]
|
||||
}
|
||||
values = convert(values, schemaElement(schema, columnMetadata.path_in_schema))
|
||||
} else if (Array.isArray(dataPage)) {
|
||||
// convert primitive types to rich types
|
||||
values = convert(dataPage, schemaElement(schema, columnMetadata.path_in_schema))
|
||||
@ -172,7 +173,7 @@ export function getColumnOffset(columnMetadata) {
|
||||
*/
|
||||
function convert(data, schemaElement) {
|
||||
const ctype = schemaElement.converted_type
|
||||
if (!ctype) return data
|
||||
if (ctype === undefined) return data
|
||||
if (ctype === ConvertedType.UTF8) {
|
||||
const decoder = new TextDecoder()
|
||||
return data.map(v => decoder.decode(v))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user