@gscdump/engine 1.4.0 → 1.4.2

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.
Files changed (366) hide show
  1. package/dist/adapters/duckdb-node.d.mts +7 -0
  2. package/dist/adapters/duckdb-node.mjs +94 -0
  3. package/dist/adapters/filesystem.d.mts +1 -1
  4. package/dist/adapters/filesystem.mjs +1 -1
  5. package/dist/adapters/hyparquet.d.mts +4 -3
  6. package/dist/adapters/hyparquet.mjs +7 -3
  7. package/dist/adapters/node-harness.d.mts +38 -0
  8. package/dist/adapters/node-harness.mjs +47 -0
  9. package/dist/adapters/node.d.mts +4 -100
  10. package/dist/adapters/node.mjs +4 -240
  11. package/dist/adapters/parquet-attach.d.mts +23 -0
  12. package/dist/adapters/parquet-attach.mjs +21 -0
  13. package/dist/adapters/r2-manifest.d.mts +82 -0
  14. package/dist/adapters/r2-manifest.mjs +364 -0
  15. package/dist/adapters/r2.d.mts +1 -1
  16. package/dist/adapters/read-optional.mjs +15 -0
  17. package/dist/adapters/snapshot-attach.d.mts +38 -0
  18. package/dist/adapters/snapshot-attach.mjs +85 -0
  19. package/dist/analysis-types.d.mts +56 -1
  20. package/dist/analyzer/define.d.mts +48 -0
  21. package/dist/analyzer/define.mjs +60 -0
  22. package/dist/analyzer/dispatch.d.mts +17 -0
  23. package/dist/analyzer/index.d.mts +4 -14
  24. package/dist/analyzer/index.mjs +4 -112
  25. package/dist/analyzer/registry.d.mts +33 -0
  26. package/dist/analyzer/registry.mjs +49 -0
  27. package/dist/analyzer/types.d.mts +95 -0
  28. package/dist/analyzer/types.mjs +5 -0
  29. package/dist/coerce.d.mts +4 -0
  30. package/dist/compaction.d.mts +14 -0
  31. package/dist/{_chunks/parquet-plan.mjs → compaction.mjs} +2 -138
  32. package/dist/contracts.d.mts +1 -2
  33. package/dist/{_chunks/schema.d.mts → drizzle-schema.d.mts} +152 -184
  34. package/dist/{_chunks/schema.mjs → drizzle-schema.mjs} +6 -78
  35. package/dist/{_chunks/snapshot.d.mts → duckdb.d.mts} +1 -14
  36. package/dist/duckdb.mjs +207 -0
  37. package/dist/engine.d.mts +4 -0
  38. package/dist/engine.mjs +385 -0
  39. package/dist/entities.d.mts +3 -52
  40. package/dist/entities.mjs +867 -2
  41. package/dist/errors.d.mts +114 -1
  42. package/dist/gc.mjs +92 -0
  43. package/dist/iceberg/append-sink.d.mts +14 -0
  44. package/dist/iceberg/append-sink.mjs +142 -0
  45. package/dist/iceberg/catalog.d.mts +71 -0
  46. package/dist/iceberg/catalog.mjs +109 -0
  47. package/dist/iceberg/index.d.mts +4 -13
  48. package/dist/iceberg/index.mjs +3 -244
  49. package/dist/iceberg/overwrite-writer.d.mts +161 -0
  50. package/dist/iceberg/overwrite-writer.mjs +102 -0
  51. package/dist/iceberg/pyiceberg-runtime.mjs +34 -0
  52. package/dist/iceberg/schema.d.mts +69 -0
  53. package/dist/{_chunks/schema2.mjs → iceberg/schema.mjs} +3 -2
  54. package/dist/index.d.mts +14 -190
  55. package/dist/index.mjs +10 -645
  56. package/dist/ingest-accumulator.d.mts +1 -1
  57. package/dist/ingest.d.mts +1 -1
  58. package/dist/layout.d.mts +31 -0
  59. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.bitreader.mjs +88 -0
  60. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.blocks.mjs +120 -0
  61. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.context.mjs +1805 -0
  62. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.contextmap.mjs +49 -0
  63. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.dictionary.mjs +984 -0
  64. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.huffman.mjs +266 -0
  65. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.mjs +340 -0
  66. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.prefix.mjs +109 -0
  67. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.streams.mjs +21 -0
  68. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.transform.mjs +190 -0
  69. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/compressors.mjs +7 -0
  70. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/gzip.huffman.mjs +121 -0
  71. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/gzip.mjs +176 -0
  72. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/index.mjs +7 -0
  73. package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/lz4.mjs +52 -0
  74. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/bloom.mjs +93 -0
  75. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/bytewriter.mjs +91 -0
  76. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/column.mjs +186 -0
  77. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/datapage.mjs +113 -0
  78. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/delta.mjs +111 -0
  79. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/dictionary.mjs +99 -0
  80. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/dremel.mjs +116 -0
  81. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/encoding.mjs +51 -0
  82. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/geospatial.mjs +84 -0
  83. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/index.mjs +7 -0
  84. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/indexes.mjs +31 -0
  85. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/metadata.mjs +138 -0
  86. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/node.mjs +8 -0
  87. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/parquet-writer.mjs +139 -0
  88. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/plain.mjs +68 -0
  89. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/schema.mjs +254 -0
  90. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/snappy.mjs +125 -0
  91. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/splitstream.mjs +38 -0
  92. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/thrift.mjs +79 -0
  93. package/dist/{_chunks/libs/hyparquet-writer.d.mts → node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/types.d.mts} +2 -2
  94. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/unconvert.mjs +247 -0
  95. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/variant.mjs +321 -0
  96. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/wkb.mjs +79 -0
  97. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/write-rows.mjs +122 -0
  98. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/write.mjs +5 -0
  99. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/bytewriter.d.mts +1 -0
  100. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/index.d.mts +10 -0
  101. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/node.d.mts +3 -0
  102. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/parquet-writer.d.mts +2 -0
  103. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/schema.d.mts +2 -0
  104. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/wkb.d.mts +1 -0
  105. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/write-rows.d.mts +1 -0
  106. package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/write.d.mts +1 -0
  107. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/assemble.mjs +3 -0
  108. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/bloom.mjs +69 -0
  109. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/column.mjs +8 -0
  110. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/constants.mjs +80 -0
  111. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/convert.mjs +3 -0
  112. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/datapage.mjs +6 -0
  113. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/delta.mjs +2 -0
  114. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/encoding.mjs +2 -0
  115. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/filter.mjs +3 -0
  116. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/geoparquet.mjs +1 -0
  117. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/index.mjs +7 -0
  118. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/indexes.mjs +5 -0
  119. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/metadata.mjs +7 -0
  120. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/node.mjs +3 -0
  121. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/plain.mjs +1 -0
  122. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/plan.mjs +5 -0
  123. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/query.mjs +3 -0
  124. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/read.mjs +6 -0
  125. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/rowgroup.mjs +7 -0
  126. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/schema.mjs +54 -0
  127. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/snappy.mjs +1 -0
  128. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/thrift.mjs +1 -0
  129. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/types.d.mts +1 -0
  130. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/utils.mjs +19 -0
  131. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/variant.mjs +3 -0
  132. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/wkb.mjs +1 -0
  133. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/xxhash.mjs +68 -0
  134. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/index.d.mts +7 -0
  135. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/indexes.d.mts +1 -0
  136. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/metadata.d.mts +1 -0
  137. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/node.d.mts +2 -0
  138. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/query.d.mts +1 -0
  139. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/read.d.mts +1 -0
  140. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/snappy.d.mts +1 -0
  141. package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/utils.d.mts +1 -0
  142. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/assemble.mjs +144 -0
  143. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/bloom.mjs +124 -0
  144. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/column.mjs +127 -0
  145. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/constants.mjs +75 -0
  146. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/convert.mjs +118 -0
  147. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/datapage.mjs +144 -0
  148. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/delta.mjs +65 -0
  149. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/encoding.mjs +76 -0
  150. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/filter.mjs +98 -0
  151. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/geoparquet.mjs +24 -0
  152. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/index.mjs +7 -0
  153. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/indexes.mjs +16 -0
  154. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/metadata.mjs +235 -0
  155. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/node.mjs +7 -0
  156. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/plain.mjs +78 -0
  157. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/plan.mjs +147 -0
  158. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/query.mjs +3 -0
  159. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/read.mjs +106 -0
  160. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/rowgroup.mjs +154 -0
  161. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/schema.mjs +75 -0
  162. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/snappy.mjs +70 -0
  163. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/thrift.mjs +86 -0
  164. package/dist/{_chunks/libs/hyparquet.d.mts → node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/types.d.mts} +6 -8
  165. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/utils.mjs +31 -0
  166. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/variant.mjs +225 -0
  167. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/wkb.mjs +94 -0
  168. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/xxhash.mjs +68 -0
  169. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/index.d.mts +10 -0
  170. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/indexes.d.mts +1 -0
  171. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/metadata.d.mts +1 -0
  172. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/node.d.mts +3 -0
  173. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/query.d.mts +1 -0
  174. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/read.d.mts +1 -0
  175. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/snappy.d.mts +1 -0
  176. package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/utils.d.mts +1 -0
  177. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.metadata.mjs +1 -0
  178. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.read.mjs +4 -0
  179. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.write.mjs +2 -0
  180. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/file.mjs +1 -0
  181. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/loadTable.mjs +3 -0
  182. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/rest.mjs +73 -0
  183. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/create.mjs +67 -0
  184. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/delete.mjs +2 -0
  185. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/fetch.mjs +8 -0
  186. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/index.mjs +13 -0
  187. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/json.mjs +147 -0
  188. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/manifest.mjs +2 -0
  189. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/metadata.mjs +3 -0
  190. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/prune.mjs +4 -0
  191. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/deletion-vector.mjs +2 -0
  192. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/puffin.mjs +2 -0
  193. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/roaring.mjs +1 -0
  194. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/read.mjs +9 -0
  195. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/s3.mjs +3 -0
  196. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/schema.mjs +76 -0
  197. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sigv4.mjs +2 -0
  198. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/icebergDataSource.mjs +8 -0
  199. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/icebergQuery.mjs +5 -0
  200. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/whereFilter.mjs +1 -0
  201. package/dist/{_chunks/libs/icebird.d.mts → node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/types.d.mts} +5 -33
  202. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/utils.mjs +8 -0
  203. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/commit.mjs +5 -0
  204. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/conversions.mjs +19 -0
  205. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/delete-file.mjs +3 -0
  206. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/geospatial.mjs +1 -0
  207. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/manifest-list.mjs +2 -0
  208. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/manifest.mjs +3 -0
  209. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/parquet.mjs +5 -0
  210. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/partition.mjs +75 -0
  211. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/rewrite.mjs +10 -0
  212. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/serde.mjs +2 -0
  213. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/snapshot.mjs +5 -0
  214. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/sort.mjs +3 -0
  215. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage-deletion-vector.mjs +11 -0
  216. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage-position-delete.mjs +8 -0
  217. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage.mjs +10 -0
  218. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stats.mjs +4 -0
  219. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/transform.mjs +60 -0
  220. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/write.mjs +45 -0
  221. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/catalog/file.d.mts +1 -0
  222. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/catalog/rest.d.mts +1 -0
  223. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/create.d.mts +1 -0
  224. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/fetch.d.mts +1 -0
  225. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/index.d.mts +13 -0
  226. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/manifest.d.mts +1 -0
  227. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/metadata.d.mts +1 -0
  228. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/read.d.mts +2 -0
  229. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/s3.d.mts +1 -0
  230. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/sql/icebergDataSource.d.mts +2 -0
  231. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/sql/icebergQuery.d.mts +2 -0
  232. package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/write/write.d.mts +32 -0
  233. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/ast.d.mts +1 -0
  234. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/backend/dataSource.mjs +1 -0
  235. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/accumulator.mjs +2 -0
  236. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/aggregates.mjs +10 -0
  237. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/execute.mjs +15 -0
  238. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/join.mjs +5 -0
  239. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/scanColumn.mjs +1 -0
  240. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/sort.mjs +5 -0
  241. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/streamingAggregate.mjs +9 -0
  242. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/utils.mjs +1 -0
  243. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/window.mjs +5 -0
  244. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/yield.mjs +17 -0
  245. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/alias.mjs +1 -0
  246. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/binary.mjs +1 -0
  247. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/date.mjs +1 -0
  248. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/evaluate.mjs +15 -0
  249. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/math.mjs +1 -0
  250. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/regexp.mjs +2 -0
  251. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/strings.mjs +3 -0
  252. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/index.d.mts +1 -0
  253. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/index.mjs +9 -0
  254. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/expression.mjs +6 -0
  255. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/extractTables.mjs +1 -0
  256. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/functions.mjs +5 -0
  257. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/joins.mjs +7 -0
  258. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/parse.mjs +10 -0
  259. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/primary.mjs +8 -0
  260. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/state.mjs +2 -0
  261. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/tokenize.mjs +3 -0
  262. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/types.d.mts +1 -0
  263. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/columns.mjs +3 -0
  264. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/plan.mjs +7 -0
  265. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/types.d.mts +1 -0
  266. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/bbox.mjs +2 -0
  267. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/equality.mjs +2 -0
  268. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/operations.mjs +5 -0
  269. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/pointRelations.mjs +2 -0
  270. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/primitives.mjs +2 -0
  271. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/segments.mjs +2 -0
  272. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/spatial.mjs +6 -0
  273. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/wkt.mjs +1 -0
  274. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/types.d.mts +3 -0
  275. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/aggregates.mjs +3 -0
  276. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/executionErrors.mjs +2 -0
  277. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/functions.mjs +2 -0
  278. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/keywords.mjs +1 -0
  279. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/parseErrors.mjs +2 -0
  280. package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/tables.mjs +2 -0
  281. package/dist/parquet-plan.d.mts +15 -0
  282. package/dist/parquet-plan.mjs +139 -0
  283. package/dist/parquet-pushdown.mjs +58 -0
  284. package/dist/period/index.d.mts +52 -1
  285. package/dist/planner.d.mts +2 -14
  286. package/dist/planner.mjs +2 -1
  287. package/dist/profile.d.mts +21 -0
  288. package/dist/profile.mjs +27 -0
  289. package/dist/query-dim.d.mts +54 -0
  290. package/dist/query-dim.mjs +91 -0
  291. package/dist/report/define.d.mts +8 -0
  292. package/dist/report/define.mjs +15 -0
  293. package/dist/report/hash.d.mts +13 -0
  294. package/dist/report/hash.mjs +29 -0
  295. package/dist/report/index.d.mts +4 -170
  296. package/dist/report/index.mjs +3 -55
  297. package/dist/report/registry.d.mts +18 -0
  298. package/dist/report/registry.mjs +14 -0
  299. package/dist/report/types.d.mts +139 -0
  300. package/dist/resolver/adapter.d.mts +13 -0
  301. package/dist/resolver/adapter.mjs +27 -0
  302. package/dist/resolver/canonical-source.d.mts +5 -0
  303. package/dist/resolver/canonical-source.mjs +14 -0
  304. package/dist/resolver/compile.d.mts +15 -0
  305. package/dist/resolver/compile.mjs +396 -0
  306. package/dist/resolver/datasets.d.mts +16 -0
  307. package/dist/resolver/datasets.mjs +159 -0
  308. package/dist/resolver/extras-overlay.d.mts +37 -0
  309. package/dist/resolver/extras-overlay.mjs +17 -0
  310. package/dist/resolver/filter-utils.d.mts +10 -0
  311. package/dist/resolver/filter-utils.mjs +59 -0
  312. package/dist/resolver/fragments.d.mts +60 -0
  313. package/dist/resolver/fragments.mjs +206 -0
  314. package/dist/resolver/index.d.mts +11 -371
  315. package/dist/resolver/index.mjs +10 -1
  316. package/dist/resolver/pg-adapter.d.mts +56 -0
  317. package/dist/resolver/pg-adapter.mjs +112 -0
  318. package/dist/resolver/run-query.d.mts +172 -0
  319. package/dist/resolver/run-query.mjs +241 -0
  320. package/dist/resolver/schema-drift.d.mts +15 -0
  321. package/dist/resolver/schema-drift.mjs +12 -0
  322. package/dist/rollups.d.mts +4 -4
  323. package/dist/rollups.mjs +3 -2
  324. package/dist/schedule.mjs +100 -0
  325. package/dist/schema.d.mts +34 -1
  326. package/dist/schema.mjs +78 -1
  327. package/dist/sink-node.d.mts +1 -159
  328. package/dist/sink-node.mjs +1 -133
  329. package/dist/sink.d.mts +125 -0
  330. package/dist/sinks/in-memory-sink.d.mts +25 -0
  331. package/dist/sinks/in-memory-sink.mjs +61 -0
  332. package/dist/sinks/index.d.mts +2 -0
  333. package/dist/sinks/index.mjs +2 -0
  334. package/dist/snapshot.d.mts +14 -0
  335. package/dist/source/attached-table.d.mts +45 -0
  336. package/dist/source/attached-table.mjs +55 -0
  337. package/dist/source/create-sql-query-source.d.mts +24 -0
  338. package/dist/source/create-sql-query-source.mjs +28 -0
  339. package/dist/source/index.d.mts +6 -66
  340. package/dist/source/index.mjs +9 -82
  341. package/dist/source/source-types.d.mts +49 -0
  342. package/dist/{_chunks/storage.d.mts → storage.d.mts} +4 -14
  343. package/dist/sync-config.d.mts +36 -0
  344. package/dist/sync-config.mjs +98 -0
  345. package/dist/vendor/hysnappy-purejs.mjs +12 -1
  346. package/package.json +9 -4
  347. package/dist/_chunks/analysis-types.d.mts +0 -57
  348. package/dist/_chunks/contracts.d.mts +0 -1
  349. package/dist/_chunks/engine.mjs +0 -731
  350. package/dist/_chunks/entities.mjs +0 -967
  351. package/dist/_chunks/errors.d.mts +0 -115
  352. package/dist/_chunks/index.d.mts +0 -53
  353. package/dist/_chunks/libs/hyparquet-compressors.mjs +0 -2796
  354. package/dist/_chunks/libs/hyparquet-writer.mjs +0 -2524
  355. package/dist/_chunks/libs/hyparquet.mjs +0 -2596
  356. package/dist/_chunks/libs/icebird.mjs +0 -564
  357. package/dist/_chunks/registry.d.mts +0 -213
  358. package/dist/_chunks/resolver.mjs +0 -1220
  359. package/dist/_chunks/sink.d.mts +0 -257
  360. /package/dist/{_chunks → analyzer}/dispatch.mjs +0 -0
  361. /package/dist/{_chunks/coerce.mjs → coerce.mjs} +0 -0
  362. /package/dist/{_chunks/layout.mjs → layout.mjs} +0 -0
  363. /package/dist/{_chunks/manifest-store-utils.mjs → manifest-store-utils.mjs} +0 -0
  364. /package/dist/{_chunks/libs/fzstd.mjs → node_modules/.pnpm/fzstd@0.1.1/node_modules/fzstd/esm/index.mjs} +0 -0
  365. /package/dist/{_chunks → resolver}/types.d.mts +0 -0
  366. /package/dist/{_chunks/schedule.d.mts → schedule.d.mts} +0 -0
@@ -0,0 +1,78 @@
1
+ function readPlain(reader, type, count, fixedLength) {
2
+ if (count === 0) return [];
3
+ if (type === "BOOLEAN") return readPlainBoolean(reader, count);
4
+ else if (type === "INT32") return readPlainInt32(reader, count);
5
+ else if (type === "INT64") return readPlainInt64(reader, count);
6
+ else if (type === "INT96") return readPlainInt96(reader, count);
7
+ else if (type === "FLOAT") return readPlainFloat(reader, count);
8
+ else if (type === "DOUBLE") return readPlainDouble(reader, count);
9
+ else if (type === "BYTE_ARRAY") return readPlainByteArray(reader, count);
10
+ else if (type === "FIXED_LEN_BYTE_ARRAY") {
11
+ if (!fixedLength) throw new Error("parquet missing fixed length");
12
+ return readPlainByteArrayFixed(reader, count, fixedLength);
13
+ } else throw new Error(`parquet unhandled type: ${type}`);
14
+ }
15
+ function readPlainBoolean(reader, count) {
16
+ const values = new Array(count);
17
+ for (let i = 0; i < count; i++) {
18
+ const byteOffset = reader.offset + (i / 8 | 0);
19
+ const bitOffset = i % 8;
20
+ values[i] = (reader.view.getUint8(byteOffset) & 1 << bitOffset) !== 0;
21
+ }
22
+ reader.offset += Math.ceil(count / 8);
23
+ return values;
24
+ }
25
+ function readPlainInt32(reader, count) {
26
+ const values = (reader.view.byteOffset + reader.offset) % 4 ? new Int32Array(align(reader.view.buffer, reader.view.byteOffset + reader.offset, count * 4)) : new Int32Array(reader.view.buffer, reader.view.byteOffset + reader.offset, count);
27
+ reader.offset += count * 4;
28
+ return values;
29
+ }
30
+ function readPlainInt64(reader, count) {
31
+ const values = (reader.view.byteOffset + reader.offset) % 8 ? new BigInt64Array(align(reader.view.buffer, reader.view.byteOffset + reader.offset, count * 8)) : new BigInt64Array(reader.view.buffer, reader.view.byteOffset + reader.offset, count);
32
+ reader.offset += count * 8;
33
+ return values;
34
+ }
35
+ function readPlainInt96(reader, count) {
36
+ const values = new Array(count);
37
+ for (let i = 0; i < count; i++) {
38
+ const low = reader.view.getBigInt64(reader.offset + i * 12, true);
39
+ const high = reader.view.getInt32(reader.offset + i * 12 + 8, true);
40
+ values[i] = BigInt(high) << 64n | low;
41
+ }
42
+ reader.offset += count * 12;
43
+ return values;
44
+ }
45
+ function readPlainFloat(reader, count) {
46
+ const values = (reader.view.byteOffset + reader.offset) % 4 ? new Float32Array(align(reader.view.buffer, reader.view.byteOffset + reader.offset, count * 4)) : new Float32Array(reader.view.buffer, reader.view.byteOffset + reader.offset, count);
47
+ reader.offset += count * 4;
48
+ return values;
49
+ }
50
+ function readPlainDouble(reader, count) {
51
+ const values = (reader.view.byteOffset + reader.offset) % 8 ? new Float64Array(align(reader.view.buffer, reader.view.byteOffset + reader.offset, count * 8)) : new Float64Array(reader.view.buffer, reader.view.byteOffset + reader.offset, count);
52
+ reader.offset += count * 8;
53
+ return values;
54
+ }
55
+ function readPlainByteArray(reader, count) {
56
+ const values = new Array(count);
57
+ for (let i = 0; i < count; i++) {
58
+ const length = reader.view.getUint32(reader.offset, true);
59
+ reader.offset += 4;
60
+ values[i] = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, length);
61
+ reader.offset += length;
62
+ }
63
+ return values;
64
+ }
65
+ function readPlainByteArrayFixed(reader, count, fixedLength) {
66
+ const values = new Array(count);
67
+ for (let i = 0; i < count; i++) {
68
+ values[i] = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, fixedLength);
69
+ reader.offset += fixedLength;
70
+ }
71
+ return values;
72
+ }
73
+ function align(buffer, offset, size) {
74
+ const aligned = new ArrayBuffer(size);
75
+ new Uint8Array(aligned).set(new Uint8Array(buffer, offset, size));
76
+ return aligned;
77
+ }
78
+ export { readPlain };
@@ -0,0 +1,147 @@
1
+ import { getPhysicalColumns } from "./schema.mjs";
2
+ import { parquetSchema } from "./metadata.mjs";
3
+ import { bloomEligibleColumns, readBloomFilter } from "./bloom.mjs";
4
+ import { canSkipRowGroup } from "./filter.mjs";
5
+ const runLimit = 1 << 21;
6
+ function parquetPlan({ metadata, rowStart = 0, rowEnd = Infinity, columns, filter, filterStrict = true, useOffsetIndex = false, bloomFiltersByGroup, schemaElements }) {
7
+ if (!metadata) throw new Error("parquetPlan requires metadata");
8
+ const groups = [];
9
+ const fetches = [];
10
+ const indexes = [];
11
+ const physicalColumns = getPhysicalColumns(parquetSchema(metadata));
12
+ let groupStart = 0;
13
+ let rgIdx = 0;
14
+ for (const rowGroup of metadata.row_groups) {
15
+ const groupRows = Number(rowGroup.num_rows);
16
+ const groupEnd = groupStart + groupRows;
17
+ const bloomFilters = bloomFiltersByGroup?.[rgIdx];
18
+ if (groupRows > 0 && groupEnd > rowStart && groupStart < rowEnd && !canSkipRowGroup({
19
+ rowGroup,
20
+ physicalColumns,
21
+ filter,
22
+ strict: filterStrict,
23
+ bloomFilters,
24
+ schemaElements
25
+ })) {
26
+ const chunks = [];
27
+ let groupStartByte = Infinity;
28
+ let groupEndByte = -Infinity;
29
+ for (const chunk of rowGroup.columns) {
30
+ const meta = chunk.meta_data;
31
+ if (chunk.file_path) throw new Error("parquet file_path not supported");
32
+ if (!meta) throw new Error("parquet column metadata is undefined");
33
+ if (!columns || columns.includes(meta.path_in_schema[0])) {
34
+ const columnOffset = meta.dictionary_page_offset || meta.data_page_offset;
35
+ const startByte = Number(columnOffset);
36
+ const endByte = Number(columnOffset + meta.total_compressed_size);
37
+ if (startByte < groupStartByte) groupStartByte = startByte;
38
+ if (endByte > groupEndByte) groupEndByte = endByte;
39
+ if (useOffsetIndex && chunk.offset_index_offset && chunk.offset_index_length && (rowStart > groupStart || rowEnd < groupEnd)) {
40
+ const offsetIndexStart = Number(chunk.offset_index_offset);
41
+ chunks.push({
42
+ columnMetadata: meta,
43
+ offsetIndex: {
44
+ startByte: offsetIndexStart,
45
+ endByte: offsetIndexStart + chunk.offset_index_length
46
+ },
47
+ range: {
48
+ startByte,
49
+ endByte
50
+ }
51
+ });
52
+ } else chunks.push({
53
+ columnMetadata: meta,
54
+ range: {
55
+ startByte,
56
+ endByte
57
+ }
58
+ });
59
+ }
60
+ }
61
+ const selectStart = Math.max(rowStart - groupStart, 0);
62
+ const selectEnd = Math.min(rowEnd - groupStart, groupRows);
63
+ groups.push({
64
+ chunks,
65
+ rowGroup,
66
+ groupStart,
67
+ groupRows,
68
+ selectStart,
69
+ selectEnd
70
+ });
71
+ let run;
72
+ for (const chunk of chunks) if ("offsetIndex" in chunk) indexes.push(chunk.offsetIndex);
73
+ else {
74
+ const { range } = chunk;
75
+ if (columns) fetches.push(range);
76
+ else if (run && range.endByte - run.startByte <= runLimit) run.endByte = range.endByte;
77
+ else {
78
+ if (run) fetches.push(run);
79
+ run = { ...range };
80
+ }
81
+ }
82
+ if (run) fetches.push(run);
83
+ }
84
+ groupStart = groupEnd;
85
+ rgIdx++;
86
+ }
87
+ if (!isFinite(rowEnd)) rowEnd = groupStart;
88
+ fetches.push(...indexes);
89
+ return {
90
+ metadata,
91
+ rowStart,
92
+ rowEnd,
93
+ columns,
94
+ fetches,
95
+ groups
96
+ };
97
+ }
98
+ async function prefetchBloomFilters({ file, metadata, filter, filterStrict = true }) {
99
+ const result = metadata.row_groups.map(() => ({}));
100
+ const eligibleCols = bloomEligibleColumns(filter);
101
+ if (eligibleCols.size === 0) return result;
102
+ const physicalColumns = getPhysicalColumns(parquetSchema(metadata));
103
+ const tasks = [];
104
+ metadata.row_groups.forEach((rowGroup, rgIdx) => {
105
+ if (canSkipRowGroup({
106
+ rowGroup,
107
+ physicalColumns,
108
+ filter,
109
+ strict: filterStrict
110
+ })) return;
111
+ for (const colName of eligibleCols) {
112
+ const columnIdx = physicalColumns.indexOf(colName);
113
+ if (columnIdx === -1) continue;
114
+ const meta = rowGroup.columns[columnIdx]?.meta_data;
115
+ if (!meta?.bloom_filter_offset || !meta.bloom_filter_length) continue;
116
+ const start = Number(meta.bloom_filter_offset);
117
+ const end = start + meta.bloom_filter_length;
118
+ tasks.push((async () => {
119
+ const buffer = await file.slice(start, end);
120
+ const bloom = readBloomFilter({
121
+ view: new DataView(buffer),
122
+ offset: 0
123
+ });
124
+ if (bloom) result[rgIdx][colName] = bloom;
125
+ })());
126
+ }
127
+ });
128
+ if (tasks.length) await Promise.all(tasks);
129
+ return result;
130
+ }
131
+ function prefetchAsyncBuffer(file, { fetches }) {
132
+ const promises = fetches.map(({ startByte, endByte }) => file.slice(startByte, endByte));
133
+ return {
134
+ byteLength: file.byteLength,
135
+ slice(start, end = file.byteLength) {
136
+ const index = fetches.findIndex(({ startByte, endByte }) => startByte <= start && end <= endByte);
137
+ if (index < 0) return file.slice(start, end);
138
+ if (fetches[index].startByte !== start || fetches[index].endByte !== end) {
139
+ const startOffset = start - fetches[index].startByte;
140
+ const endOffset = end - fetches[index].startByte;
141
+ if (promises[index] instanceof Promise) return promises[index].then((buffer) => buffer.slice(startOffset, endOffset));
142
+ else return promises[index].slice(startOffset, endOffset);
143
+ } else return promises[index];
144
+ }
145
+ };
146
+ }
147
+ export { parquetPlan, prefetchAsyncBuffer, prefetchBloomFilters };
@@ -0,0 +1,3 @@
1
+ import "./metadata.mjs";
2
+ import "./read.mjs";
3
+ export {};
@@ -0,0 +1,106 @@
1
+ import { parquetMetadataAsync, parquetSchema } from "./metadata.mjs";
2
+ import { concat } from "./utils.mjs";
3
+ import { columnsNeededForFilter, matchFilter } from "./filter.mjs";
4
+ import { parquetPlan, prefetchAsyncBuffer, prefetchBloomFilters } from "./plan.mjs";
5
+ import { assembleAsync, asyncGroupToRows, readRowGroup } from "./rowgroup.mjs";
6
+ async function parquetRead(options) {
7
+ options.metadata ??= await parquetMetadataAsync(options.file, options);
8
+ const { rowStart = 0, rowEnd, columns, onChunk, onComplete, rowFormat, filter, filterStrict = true } = options;
9
+ if (filter && rowFormat !== "object") throw new Error("parquet filter requires rowFormat: \"object\"");
10
+ const filterColumns = columnsNeededForFilter(filter);
11
+ if (filterColumns.length) {
12
+ const schemaColumns = parquetSchema(options.metadata).children.map((c) => c.element.name);
13
+ const missingColumns = filterColumns.filter((c) => !schemaColumns.includes(c));
14
+ if (missingColumns.length) throw new Error(`parquet filter columns not found: ${missingColumns.join(", ")}`);
15
+ }
16
+ let readColumns = columns;
17
+ let requiresProjection = false;
18
+ if (columns && filter) {
19
+ const missingFilterColumns = filterColumns.filter((c) => !columns.includes(c));
20
+ if (missingFilterColumns.length) {
21
+ readColumns = [...columns, ...missingFilterColumns];
22
+ requiresProjection = true;
23
+ }
24
+ }
25
+ let readOptions = readColumns !== columns ? {
26
+ ...options,
27
+ columns: readColumns
28
+ } : options;
29
+ readOptions = await withBloomFilters(readOptions);
30
+ const asyncGroups = parquetReadAsync(readOptions);
31
+ if (!onComplete && !onChunk) {
32
+ await awaitAllColumns(asyncGroups);
33
+ return;
34
+ }
35
+ const schemaTree = parquetSchema(options.metadata);
36
+ const assembled = asyncGroups.map((arg) => assembleAsync(arg, schemaTree, options.parsers));
37
+ if (onChunk) for (const asyncGroup of assembled) for (const asyncColumn of asyncGroup.asyncColumns) asyncColumn.data.then(({ data, skipped }) => {
38
+ let rowStart = asyncGroup.groupStart + skipped;
39
+ for (const columnData of data) {
40
+ onChunk({
41
+ columnName: asyncColumn.pathInSchema[0],
42
+ columnData,
43
+ rowStart,
44
+ rowEnd: rowStart + columnData.length
45
+ });
46
+ rowStart += columnData.length;
47
+ }
48
+ }, () => {});
49
+ if (onComplete) {
50
+ await awaitAllColumns(assembled);
51
+ const rows = [];
52
+ for (const asyncGroup of assembled) {
53
+ const selectStart = Math.max(rowStart - asyncGroup.groupStart, 0);
54
+ const selectEnd = Math.min((rowEnd ?? Infinity) - asyncGroup.groupStart, asyncGroup.groupRows);
55
+ const groupData = rowFormat === "object" ? await asyncGroupToRows(asyncGroup, selectStart, selectEnd, readColumns, "object") : await asyncGroupToRows(asyncGroup, selectStart, selectEnd, columns, "array");
56
+ if (filter) {
57
+ for (const row of groupData) if (matchFilter(row, filter, filterStrict)) {
58
+ if (requiresProjection && columns) {
59
+ for (const col of filterColumns) if (!columns.includes(col)) delete row[col];
60
+ }
61
+ rows.push(row);
62
+ }
63
+ } else concat(rows, groupData);
64
+ }
65
+ onComplete(rows);
66
+ } else await awaitAllColumns(assembled);
67
+ }
68
+ async function awaitAllColumns(asyncGroups) {
69
+ const all = asyncGroups.flatMap((g) => g.asyncColumns.map((c) => c.data));
70
+ const failed = (await Promise.allSettled(all)).find((r) => r.status === "rejected");
71
+ if (failed) throw failed.reason;
72
+ }
73
+ function parquetReadAsync(options) {
74
+ if (!options.metadata) throw new Error("parquet requires metadata");
75
+ const plan = parquetPlan(options);
76
+ options.file = prefetchAsyncBuffer(options.file, plan);
77
+ return plan.groups.map((groupPlan) => readRowGroup(options, plan, groupPlan));
78
+ }
79
+ async function withBloomFilters(options) {
80
+ if (!options.useBloomFilters) return options;
81
+ if (!options.filter || !options.metadata) return options;
82
+ const schemaTree = parquetSchema(options.metadata);
83
+ const schemaElements = {};
84
+ for (const child of schemaTree.children) schemaElements[child.element.name] = child.element;
85
+ const bloomFiltersByGroup = await prefetchBloomFilters({
86
+ file: options.file,
87
+ metadata: options.metadata,
88
+ filter: options.filter,
89
+ filterStrict: options.filterStrict
90
+ });
91
+ return {
92
+ ...options,
93
+ bloomFiltersByGroup,
94
+ schemaElements
95
+ };
96
+ }
97
+ function parquetReadObjects(options) {
98
+ return new Promise((onComplete, reject) => {
99
+ parquetRead({
100
+ ...options,
101
+ rowFormat: "object",
102
+ onComplete
103
+ }).catch(reject);
104
+ });
105
+ }
106
+ export { parquetRead, parquetReadAsync, parquetReadObjects };
@@ -0,0 +1,154 @@
1
+ import { DEFAULT_PARSERS } from "./convert.mjs";
2
+ import { getSchemaPath } from "./schema.mjs";
3
+ import { readOffsetIndex } from "./indexes.mjs";
4
+ import { flatten } from "./utils.mjs";
5
+ import { assembleNested } from "./assemble.mjs";
6
+ import { readColumn } from "./column.mjs";
7
+ function readRowGroup(options, { metadata }, groupPlan) {
8
+ const asyncColumns = [];
9
+ for (const chunk of groupPlan.chunks) {
10
+ const { data_page_offset, dictionary_page_offset, path_in_schema: pathInSchema } = chunk.columnMetadata;
11
+ const schemaPath = getSchemaPath(metadata.schema, pathInSchema);
12
+ const columnDecoder = {
13
+ pathInSchema,
14
+ element: schemaPath[schemaPath.length - 1].element,
15
+ schemaPath,
16
+ parsers: {
17
+ ...DEFAULT_PARSERS,
18
+ ...options.parsers
19
+ },
20
+ ...options,
21
+ ...chunk.columnMetadata
22
+ };
23
+ let { startByte, endByte } = chunk.range;
24
+ if (!("offsetIndex" in chunk)) {
25
+ asyncColumns.push({
26
+ pathInSchema,
27
+ data: Promise.resolve(options.file.slice(startByte, endByte)).then((buffer) => {
28
+ return readColumn({
29
+ view: new DataView(buffer),
30
+ offset: 0
31
+ }, groupPlan, columnDecoder, options.onPage);
32
+ })
33
+ });
34
+ continue;
35
+ }
36
+ asyncColumns.push({
37
+ pathInSchema,
38
+ data: Promise.resolve(options.file.slice(chunk.offsetIndex.startByte, chunk.offsetIndex.endByte)).then(async (arrayBuffer) => {
39
+ const { selectStart, selectEnd } = groupPlan;
40
+ const pages = readOffsetIndex({
41
+ view: new DataView(arrayBuffer),
42
+ offset: 0
43
+ }).page_locations;
44
+ let skipped = -1;
45
+ const hasDict = dictionary_page_offset || data_page_offset < pages[0].offset;
46
+ for (let i = 0; i < pages.length; i++) {
47
+ const page = pages[i];
48
+ const pageStart = Number(page.first_row_index);
49
+ const pageEnd = i + 1 < pages.length ? Number(pages[i + 1].first_row_index) : groupPlan.groupRows;
50
+ if (skipped < 0 && !hasDict && pageEnd > selectStart) {
51
+ startByte = Number(page.offset);
52
+ skipped = pageStart;
53
+ }
54
+ if (pageStart < selectEnd) endByte = Number(page.offset) + page.compressed_page_size;
55
+ }
56
+ if (skipped < 0) skipped = 0;
57
+ const buffer = await options.file.slice(startByte, endByte);
58
+ const { data, skipped: columnSkipped } = readColumn({
59
+ view: new DataView(buffer),
60
+ offset: 0
61
+ }, skipped ? {
62
+ ...groupPlan,
63
+ groupStart: groupPlan.groupStart + skipped,
64
+ selectStart: groupPlan.selectStart - skipped,
65
+ selectEnd: groupPlan.selectEnd - skipped
66
+ } : groupPlan, columnDecoder, options.onPage);
67
+ return {
68
+ data,
69
+ skipped: skipped + columnSkipped
70
+ };
71
+ })
72
+ });
73
+ }
74
+ return {
75
+ groupStart: groupPlan.groupStart,
76
+ groupRows: groupPlan.groupRows,
77
+ asyncColumns
78
+ };
79
+ }
80
+ async function asyncGroupToRows({ asyncColumns }, selectStart, selectEnd, columns, rowFormat) {
81
+ const asyncPages = await Promise.all(asyncColumns.map((column) => column.data.then(({ skipped, data }) => ({
82
+ skipped,
83
+ data: flatten(data)
84
+ }))));
85
+ const selectCount = selectEnd - selectStart;
86
+ if (rowFormat === "object") {
87
+ const groupData = Array(selectCount);
88
+ for (let selectRow = 0; selectRow < selectCount; selectRow++) {
89
+ const rowData = {};
90
+ for (let i = 0; i < asyncColumns.length; i++) {
91
+ const { data, skipped } = asyncPages[i];
92
+ rowData[asyncColumns[i].pathInSchema[0]] = data[selectStart + selectRow - skipped];
93
+ }
94
+ groupData[selectRow] = rowData;
95
+ }
96
+ return groupData;
97
+ }
98
+ const includedColumnNames = asyncColumns.map((child) => child.pathInSchema[0]).filter((name) => !columns || columns.includes(name));
99
+ const columnOrder = columns ?? includedColumnNames;
100
+ const columnIndexes = columnOrder.map((name) => asyncColumns.findIndex((column) => column.pathInSchema[0] === name));
101
+ const groupData = Array(selectCount);
102
+ for (let selectRow = 0; selectRow < selectCount; selectRow++) {
103
+ const rowData = Array(asyncColumns.length);
104
+ for (let i = 0; i < columnOrder.length; i++) {
105
+ const colIdx = columnIndexes[i];
106
+ if (colIdx < 0) throw new Error(`parquet column not found: ${columnOrder[i]}`);
107
+ const { data, skipped } = asyncPages[colIdx];
108
+ rowData[i] = data[selectStart + selectRow - skipped];
109
+ }
110
+ groupData[selectRow] = rowData;
111
+ }
112
+ return groupData;
113
+ }
114
+ function assembleAsync(asyncRowGroup, schemaTree, parsers) {
115
+ const { asyncColumns } = asyncRowGroup;
116
+ parsers = {
117
+ ...DEFAULT_PARSERS,
118
+ ...parsers
119
+ };
120
+ const assembled = [];
121
+ for (const child of schemaTree.children) if (child.children.length) {
122
+ const childColumns = asyncColumns.filter((column) => column.pathInSchema[0] === child.element.name);
123
+ if (!childColumns.length) continue;
124
+ assembled.push({
125
+ pathInSchema: child.path,
126
+ data: (async () => {
127
+ const resolved = await Promise.all(childColumns.map((c) => c.data));
128
+ const subcolumnData = /* @__PURE__ */ new Map();
129
+ let minLength = Infinity;
130
+ for (let i = 0; i < childColumns.length; i++) {
131
+ const flat = flatten(resolved[i].data);
132
+ subcolumnData.set(childColumns[i].pathInSchema.join("."), flat);
133
+ minLength = Math.min(minLength, flat.length);
134
+ }
135
+ for (const [key, value] of subcolumnData) if (value.length > minLength) subcolumnData.set(key, value.slice(0, minLength));
136
+ assembleNested(subcolumnData, child, parsers);
137
+ const assembled = subcolumnData.get(child.element.name);
138
+ if (!assembled) throw new Error("parquet column data not assembled");
139
+ return {
140
+ data: [assembled],
141
+ skipped: 0
142
+ };
143
+ })()
144
+ });
145
+ } else {
146
+ const asyncColumn = asyncColumns.find((column) => column.pathInSchema[0] === child.element.name);
147
+ if (asyncColumn) assembled.push(asyncColumn);
148
+ }
149
+ return {
150
+ ...asyncRowGroup,
151
+ asyncColumns: assembled
152
+ };
153
+ }
154
+ export { assembleAsync, asyncGroupToRows, readRowGroup };
@@ -0,0 +1,75 @@
1
+ function schemaTree(schema, rootIndex, path) {
2
+ const element = schema[rootIndex];
3
+ const children = [];
4
+ let count = 1;
5
+ if (element.num_children) while (children.length < element.num_children) {
6
+ const childElement = schema[rootIndex + count];
7
+ const child = schemaTree(schema, rootIndex + count, [...path, childElement.name]);
8
+ count += child.count;
9
+ children.push(child);
10
+ }
11
+ return {
12
+ count,
13
+ element,
14
+ children,
15
+ path
16
+ };
17
+ }
18
+ function getSchemaPath(schema, name) {
19
+ let tree = schemaTree(schema, 0, []);
20
+ const path = [tree];
21
+ for (const part of name) {
22
+ const child = tree.children.find((child) => child.element.name === part);
23
+ if (!child) throw new Error(`parquet schema element not found: ${name}`);
24
+ path.push(child);
25
+ tree = child;
26
+ }
27
+ return path;
28
+ }
29
+ function getPhysicalColumns(schemaTree) {
30
+ const columns = [];
31
+ function traverse(node) {
32
+ if (node.children.length) for (const child of node.children) traverse(child);
33
+ else columns.push(node.path.join("."));
34
+ }
35
+ traverse(schemaTree);
36
+ return columns;
37
+ }
38
+ function getMaxRepetitionLevel(schemaPath) {
39
+ let maxLevel = 0;
40
+ for (const { element } of schemaPath) if (element.repetition_type === "REPEATED") maxLevel++;
41
+ return maxLevel;
42
+ }
43
+ function getMaxDefinitionLevel(schemaPath) {
44
+ let maxLevel = 0;
45
+ for (const { element } of schemaPath.slice(1)) if (element.repetition_type !== "REQUIRED") maxLevel++;
46
+ return maxLevel;
47
+ }
48
+ function isListLike(schema) {
49
+ if (!schema) return false;
50
+ if (schema.element.converted_type !== "LIST") return false;
51
+ if (schema.children.length > 1) return false;
52
+ const firstChild = schema.children[0];
53
+ if (firstChild.children.length > 1) return false;
54
+ if (firstChild.element.repetition_type !== "REPEATED") return false;
55
+ return true;
56
+ }
57
+ function isMapLike(schema) {
58
+ if (!schema) return false;
59
+ if (schema.element.converted_type !== "MAP") return false;
60
+ if (schema.children.length > 1) return false;
61
+ const firstChild = schema.children[0];
62
+ if (firstChild.children.length !== 2) return false;
63
+ if (firstChild.element.repetition_type !== "REPEATED") return false;
64
+ if (firstChild.children.find((child) => child.element.name === "key")?.element.repetition_type === "REPEATED") return false;
65
+ if (firstChild.children.find((child) => child.element.name === "value")?.element.repetition_type === "REPEATED") return false;
66
+ return true;
67
+ }
68
+ function isFlatColumn(schemaPath) {
69
+ if (schemaPath.length !== 2) return false;
70
+ const [, column] = schemaPath;
71
+ if (column.element.repetition_type === "REPEATED") return false;
72
+ if (column.children.length) return false;
73
+ return true;
74
+ }
75
+ export { getMaxDefinitionLevel, getMaxRepetitionLevel, getPhysicalColumns, getSchemaPath, isFlatColumn, isListLike, isMapLike };
@@ -0,0 +1,70 @@
1
+ const WORD_MASK = [
2
+ 0,
3
+ 255,
4
+ 65535,
5
+ 16777215,
6
+ 4294967295
7
+ ];
8
+ function copyBytes(fromArray, fromPos, toArray, toPos, length) {
9
+ for (let i = 0; i < length; i++) toArray[toPos + i] = fromArray[fromPos + i];
10
+ }
11
+ function snappyUncompress(input, output) {
12
+ const inputLength = input.byteLength;
13
+ const outputLength = output.byteLength;
14
+ let pos = 0;
15
+ let outPos = 0;
16
+ while (pos < inputLength) {
17
+ const c = input[pos];
18
+ pos++;
19
+ if (c < 128) break;
20
+ }
21
+ if (outputLength && pos >= inputLength) throw new Error("invalid snappy length header");
22
+ while (pos < inputLength) {
23
+ const c = input[pos];
24
+ let len = 0;
25
+ pos++;
26
+ if (pos >= inputLength) throw new Error("missing eof marker");
27
+ if ((c & 3) === 0) {
28
+ let len = (c >>> 2) + 1;
29
+ if (len > 60) {
30
+ if (pos + 3 >= inputLength) throw new Error("snappy error literal pos + 3 >= inputLength");
31
+ const lengthSize = len - 60;
32
+ len = input[pos] + (input[pos + 1] << 8) + (input[pos + 2] << 16) + (input[pos + 3] << 24);
33
+ len = (len & WORD_MASK[lengthSize]) + 1;
34
+ pos += lengthSize;
35
+ }
36
+ if (pos + len > inputLength) throw new Error("snappy error literal exceeds input length");
37
+ copyBytes(input, pos, output, outPos, len);
38
+ pos += len;
39
+ outPos += len;
40
+ } else {
41
+ let offset = 0;
42
+ switch (c & 3) {
43
+ case 1:
44
+ len = (c >>> 2 & 7) + 4;
45
+ offset = input[pos] + (c >>> 5 << 8);
46
+ pos++;
47
+ break;
48
+ case 2:
49
+ if (inputLength <= pos + 1) throw new Error("snappy error end of input");
50
+ len = (c >>> 2) + 1;
51
+ offset = input[pos] + (input[pos + 1] << 8);
52
+ pos += 2;
53
+ break;
54
+ case 3:
55
+ if (inputLength <= pos + 3) throw new Error("snappy error end of input");
56
+ len = (c >>> 2) + 1;
57
+ offset = input[pos] + (input[pos + 1] << 8) + (input[pos + 2] << 16) + (input[pos + 3] << 24);
58
+ pos += 4;
59
+ break;
60
+ default: break;
61
+ }
62
+ if (offset === 0 || isNaN(offset)) throw new Error(`invalid offset ${offset} pos ${pos} inputLength ${inputLength}`);
63
+ if (offset > outPos) throw new Error("cannot copy from before start of buffer");
64
+ copyBytes(output, outPos - offset, output, outPos, len);
65
+ outPos += len;
66
+ }
67
+ }
68
+ if (outPos !== outputLength) throw new Error("premature end of input");
69
+ }
70
+ export { snappyUncompress };