@zjlab-fe/data-hub-ui 0.32.3 → 0.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,14 @@ import initWasm, { wasmMemory, readParquet } from 'parquet-wasm';
7
7
 
8
8
  initWasm();
9
9
  let WASM_MEMORY;
10
+ function transformData(data) {
11
+ const result = {};
12
+ Object.keys(data).forEach((key) => {
13
+ const value = data[key];
14
+ result[key] = typeof value === 'bigint' ? value.toString() : String(value);
15
+ });
16
+ return result;
17
+ }
10
18
  function ParquetPreview(props) {
11
19
  var _a;
12
20
  const ref = useRef(null);
@@ -31,12 +39,12 @@ function ParquetPreview(props) {
31
39
  // console.log('+++ head', head);
32
40
  // 获取数据
33
41
  const data = [];
34
- console.log('+++ arrowTable.numRows', arrowTable.numRows);
35
42
  for (let i = 0; i < arrowTable.numRows; i++) {
36
- data.push(Object.assign(Object.assign({}, arrowTable.get(i).toJSON()), { key: i.toString() }));
43
+ data.push(Object.assign(Object.assign({}, transformData(arrowTable.get(i).toJSON())), { key: i.toString() }));
37
44
  }
38
45
  // const end = new Date().getTime();
39
46
  // console.log('+++ 耗时', end - start);
47
+ console.log('+++ parquet head data', head, data);
40
48
  setParquetData({ head, data });
41
49
  setContainerHeight((_a = ref.current) === null || _a === void 0 ? void 0 : _a.clientHeight);
42
50
  setContainerWidth((_b = ref.current) === null || _b === void 0 ? void 0 : _b.clientWidth);