Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "hyparquet", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "parquet file parser for javascript", | ||
@@ -29,13 +29,13 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/node": "20.14.12", | ||
"@typescript-eslint/eslint-plugin": "7.17.0", | ||
"@vitest/coverage-v8": "2.0.4", | ||
"@types/node": "22.1.0", | ||
"@typescript-eslint/eslint-plugin": "8.0.0", | ||
"@vitest/coverage-v8": "2.0.5", | ||
"eslint": "8.57.0", | ||
"eslint-plugin-import": "2.29.1", | ||
"eslint-plugin-jsdoc": "48.8.3", | ||
"eslint-plugin-jsdoc": "48.11.0", | ||
"http-server": "14.1.1", | ||
"hyparquet-compressors": "0.1.4", | ||
"typescript": "5.5.4", | ||
"vitest": "2.0.4" | ||
"vitest": "2.0.5" | ||
} | ||
} |
@@ -9,3 +9,3 @@ # hyparquet | ||
[![dependencies](https://img.shields.io/badge/Dependencies-0-blueviolet)](https://www.npmjs.com/package/hyparquet?activeTab=dependencies) | ||
![coverage](https://img.shields.io/badge/Coverage-96-darkred) | ||
![coverage](https://img.shields.io/badge/Coverage-95-darkred) | ||
@@ -12,0 +12,0 @@ Dependency free since 2023! |
@@ -128,3 +128,3 @@ import { isListLike, isMapLike } from './schema.js' | ||
const values = subcolumnData.get(subcolumn) | ||
if (!values) throw new Error('parquet list-like column missing values') | ||
if (!values) throw new Error('parquet list column missing values') | ||
if (optional) flattenAtDepth(values, depth) | ||
@@ -146,6 +146,6 @@ subcolumnData.set(path, values) | ||
if (!keys) throw new Error('parquet map-like column missing keys') | ||
if (!values) throw new Error('parquet map-like column missing values') | ||
if (!keys) throw new Error('parquet map column missing keys') | ||
if (!values) throw new Error('parquet map column missing values') | ||
if (keys.length !== values.length) { | ||
throw new Error('parquet map-like column key/value length mismatch') | ||
throw new Error('parquet map column key/value length mismatch') | ||
} | ||
@@ -165,8 +165,9 @@ | ||
// construct a meta struct and then invert | ||
const invertDepth = schema.element.repetition_type === 'REQUIRED' ? depth : depth + 1 | ||
/** @type {Record<string, any>} */ | ||
const struct = {} | ||
for (const child of schema.children) { | ||
assembleNested(subcolumnData, child, nextDepth) | ||
assembleNested(subcolumnData, child, invertDepth) | ||
const childData = subcolumnData.get(child.path.join('.')) | ||
if (!childData) throw new Error('parquet struct-like column missing child data') | ||
if (!childData) throw new Error('parquet struct missing child data') | ||
struct[child.element.name] = childData | ||
@@ -179,3 +180,2 @@ } | ||
// invert struct by depth | ||
const invertDepth = schema.element.repetition_type === 'REQUIRED' ? depth : depth + 1 | ||
const inverted = invertStruct(struct, invertDepth) | ||
@@ -185,3 +185,2 @@ if (optional) flattenAtDepth(inverted, depth) | ||
} | ||
// assert(schema.element.repetition_type !== 'REPEATED') | ||
} | ||
@@ -246,2 +245,3 @@ | ||
for (const key of keys) { | ||
if (struct[key].length !== length) throw new Error('parquet struct parsing error') | ||
obj[key] = struct[key][i] | ||
@@ -248,0 +248,0 @@ } |
@@ -182,3 +182,3 @@ export type Awaitable<T> = T | Promise<T> | ||
interface ColumnCryptoMetaData {} | ||
type ColumnCryptoMetaData = Record<string, never> | ||
@@ -272,3 +272,3 @@ export type Encoding = | ||
interface IndexPageHeader {} | ||
type IndexPageHeader = Record<string, never> | ||
@@ -275,0 +275,0 @@ export interface DictionaryPageHeader { |
@@ -76,3 +76,4 @@ /** | ||
export async function asyncBufferFromFile(filename) { | ||
const fs = await import('fs') | ||
const fsPackage = 'fs' // webpack no include | ||
const fs = await import(fsPackage) | ||
const stat = await fs.promises.stat(filename) | ||
@@ -79,0 +80,0 @@ return { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104791
2749