Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"dependencies": {
"hightable": "0.16.0",
"hyparquet": "1.13.5",
"hyparquet": "1.14.0",
"hyparquet-compressors": "1.1.1",
"icebird": "0.3.0",
"react": "18.3.1",
Expand All @@ -79,7 +79,7 @@
"eslint-plugin-react-hooks": "5.2.0",
"eslint-plugin-react-refresh": "0.4.20",
"eslint-plugin-storybook": "0.12.0",
"globals": "16.1.0",
"globals": "16.2.0",
"jsdom": "26.1.0",
"nodemon": "3.1.10",
"npm-run-all": "4.1.5",
Expand Down
65 changes: 0 additions & 65 deletions src/lib/getParquetColumn.ts

This file was deleted.

9 changes: 4 additions & 5 deletions src/lib/workers/parquetWorker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ColumnData, parquetQuery } from 'hyparquet'
import { compressors } from 'hyparquet-compressors'
import { getParquetColumn } from '../getParquetColumn.js'
import { parquetReadColumn } from 'hyparquet/src/read.js'
import { asyncBufferFrom } from '../utils.js'
import type { ChunkMessage, ClientMessage, ColumnRanksMessage, ErrorMessage, ResultMessage } from './types.js'

Expand Down Expand Up @@ -28,10 +28,9 @@ self.onmessage = async ({ data }: { data: ClientMessage }) => {
// purpose of sorting.

try {
const sortColumn = await getParquetColumn({ metadata, file, column, compressors })
const sortColumn: unknown[] = Array.from(await parquetReadColumn({ file, metadata, columns: [column], compressors }))
const valuesWithIndex = sortColumn.map((value, index) => ({ value, index }))
const sortedValuesWithIndex = Array.from(valuesWithIndex).sort(({ value: a }, { value: b }) => compare<unknown>(a, b))
const numRows = sortedValuesWithIndex.length
const sortedValuesWithIndex = valuesWithIndex.sort(({ value: a }, { value: b }) => compare<unknown>(a, b))
const columnRanks = sortedValuesWithIndex.reduce((accumulator, currentValue, rank) => {
const { lastValue, lastRank, ranks } = accumulator
const { value, index } = currentValue
Expand All @@ -43,7 +42,7 @@ self.onmessage = async ({ data }: { data: ClientMessage }) => {
return { ranks, lastValue: value, lastRank: rank }
}
}, {
ranks: Array(numRows).fill(-1) as number[],
ranks: Array(sortColumn.length).fill(-1) as number[],
lastValue: undefined as unknown,
lastRank: 0,
}).ranks
Expand Down