@query-farm/vgi 0.33.0 → 0.34.0

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.
@@ -1494,6 +1494,8 @@ function writeCanonicalColumn(type, canonical) {
1494
1494
  function buildColumnData(values, type) {
1495
1495
  if (DataType2.isList(type))
1496
1496
  return buildListData(values, type);
1497
+ if (DataType2.isFixedSizeList(type))
1498
+ return buildFixedSizeListData(values, type);
1497
1499
  if (DataType2.isMap(type))
1498
1500
  return buildMapData(values, type);
1499
1501
  if (DataType2.isStruct(type))
@@ -1641,6 +1643,38 @@ function buildListData(values, listType) {
1641
1643
  valueOffsets: offsets
1642
1644
  });
1643
1645
  }
1646
+ function buildFixedSizeListData(values, type) {
1647
+ const childField = type.children[0];
1648
+ const listSize = type.listSize;
1649
+ const numRows = values.length;
1650
+ const allItems = [];
1651
+ const nullBitmap = new Uint8Array(Math.ceil(numRows / 8));
1652
+ let nullCount = 0;
1653
+ for (let i = 0;i < numRows; i++) {
1654
+ const row = values[i];
1655
+ if (row == null) {
1656
+ nullCount++;
1657
+ for (let j = 0;j < listSize; j++)
1658
+ allItems.push(null);
1659
+ continue;
1660
+ }
1661
+ nullBitmap[i >> 3] |= 1 << (i & 7);
1662
+ const items = Array.isArray(row) ? row : Array.from(row);
1663
+ if (items.length !== listSize) {
1664
+ throw new TypeError(`fixed_size_list[${listSize}]: row ${i} has ${items.length} items`);
1665
+ }
1666
+ for (const item of items)
1667
+ allItems.push(item);
1668
+ }
1669
+ const childData = allItems.length > 0 ? buildColumnData(allItems, childField.type) : emptyDataForType(childField.type);
1670
+ return makeData2({
1671
+ type,
1672
+ length: numRows,
1673
+ nullCount,
1674
+ nullBitmap: nullCount > 0 ? nullBitmap : undefined,
1675
+ child: childData
1676
+ });
1677
+ }
1644
1678
  function buildMapData(values, mapType) {
1645
1679
  const numRows = values.length;
1646
1680
  const entriesField = mapType.children[0];
@@ -1732,6 +1766,14 @@ function emptyDataForType(type) {
1732
1766
  valueOffsets: new Int32Array([0])
1733
1767
  });
1734
1768
  }
1769
+ if (DataType2.isFixedSizeList(type)) {
1770
+ return makeData2({
1771
+ type,
1772
+ length: 0,
1773
+ nullCount: 0,
1774
+ child: emptyDataForType(type.children[0].type)
1775
+ });
1776
+ }
1735
1777
  if (DataType2.isStruct(type)) {
1736
1778
  const children = type.children.map((cf) => emptyDataForType(cf.type));
1737
1779
  return makeData2({ type, length: 0, nullCount: 0, children });
@@ -2500,6 +2542,8 @@ function unwrapScalar(val) {
2500
2542
  return null;
2501
2543
  if (typeof val !== "object")
2502
2544
  return val;
2545
+ if (val instanceof Date)
2546
+ return val;
2503
2547
  if (typeof val.valueOf === "function") {
2504
2548
  let v;
2505
2549
  try {
@@ -6859,4 +6903,4 @@ export {
6859
6903
  serveVgiWorker
6860
6904
  };
6861
6905
 
6862
- //# debugId=CEC41B08D9AF368564756E2164756E21
6906
+ //# debugId=5179BD5C01EA502364756E2164756E21