Skip to content

Commit dc8d2fa

Browse files
authored
Avoid bigint for metadata queries (#508)
* Avoid bigint for metadata queries * Use f64 for > 4 billion row datasets
1 parent b131ae9 commit dc8d2fa

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ npm install parquet-wasm
2424

2525
### Choice of bundles
2626

27-
| Entry point | Description | Documentation |
28-
| ---------------------------- | ------------------------------------------------------- | -------------------- |
29-
| `parquet-wasm` | ESM, to be used directly from the Web as an ES Module | [Link][esm-docs] |
30-
| `parquet-wasm/esm` (default) | ESM, to be used directly from the Web as an ES Module | [Link][esm-docs] |
31-
| `parquet-wasm/bundler` | "Bundler" build, to be used in bundlers such as Webpack | [Link][bundler-docs] |
32-
| `parquet-wasm/node` | Node build, to be used with `require` in NodeJS | [Link][node-docs] |
27+
| Entry point | Description | Documentation |
28+
| ---------------------- | ------------------------------------------------------- | -------------------- |
29+
| `parquet-wasm` | ESM, to be used directly from the Web as an ES Module | [Link][esm-docs] |
30+
| `parquet-wasm/esm` | ESM, to be used directly from the Web as an ES Module | [Link][esm-docs] |
31+
| `parquet-wasm/bundler` | "Bundler" build, to be used in bundlers such as Webpack | [Link][bundler-docs] |
32+
| `parquet-wasm/node` | Node build, to be used with `require` in NodeJS | [Link][node-docs] |
3333

3434
[bundler-docs]: https://kylebarron.dev/parquet-wasm/modules/bundler_parquet_wasm.html
3535
[node-docs]: https://kylebarron.dev/parquet-wasm/modules/node_parquet_wasm.html

src/metadata.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ impl FileMetaData {
7171

7272
/// Returns number of rows in the file.
7373
#[wasm_bindgen(js_name = numRows)]
74-
pub fn num_rows(&self) -> i64 {
75-
self.0.num_rows()
74+
pub fn num_rows(&self) -> f64 {
75+
self.0.num_rows() as f64
7676
}
7777

7878
/// String message for application that wrote this file.
@@ -147,20 +147,20 @@ impl RowGroupMetaData {
147147

148148
/// Number of rows in this row group.
149149
#[wasm_bindgen(js_name = numRows)]
150-
pub fn num_rows(&self) -> i64 {
151-
self.0.num_rows()
150+
pub fn num_rows(&self) -> f64 {
151+
self.0.num_rows() as f64
152152
}
153153

154154
/// Total byte size of all uncompressed column data in this row group.
155155
#[wasm_bindgen(js_name = totalByteSize)]
156-
pub fn total_byte_size(&self) -> i64 {
157-
self.0.total_byte_size()
156+
pub fn total_byte_size(&self) -> f64 {
157+
self.0.total_byte_size() as f64
158158
}
159159

160160
/// Total size of all compressed column data in this row group.
161161
#[wasm_bindgen(js_name = compressedSize)]
162-
pub fn compressed_size(&self) -> i64 {
163-
self.0.compressed_size()
162+
pub fn compressed_size(&self) -> f64 {
163+
self.0.compressed_size() as f64
164164
}
165165
}
166166

@@ -222,8 +222,8 @@ impl ColumnChunkMetaData {
222222

223223
/// Total number of values in this column chunk.
224224
#[wasm_bindgen(js_name = numValues)]
225-
pub fn num_values(&self) -> i64 {
226-
self.0.num_values()
225+
pub fn num_values(&self) -> f64 {
226+
self.0.num_values() as f64
227227
}
228228

229229
/// Compression for this column.
@@ -233,14 +233,14 @@ impl ColumnChunkMetaData {
233233

234234
/// Returns the total compressed data size of this column chunk.
235235
#[wasm_bindgen(js_name = compressedSize)]
236-
pub fn compressed_size(&self) -> i64 {
237-
self.0.compressed_size()
236+
pub fn compressed_size(&self) -> f64 {
237+
self.0.compressed_size() as f64
238238
}
239239

240240
/// Returns the total uncompressed data size of this column chunk.
241241
#[wasm_bindgen(js_name = uncompressedSize)]
242-
pub fn uncompressed_size(&self) -> i64 {
243-
self.0.uncompressed_size()
242+
pub fn uncompressed_size(&self) -> f64 {
243+
self.0.uncompressed_size() as f64
244244
}
245245
}
246246

0 commit comments

Comments
 (0)