@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,144 @@
1
+ import { getMaxDefinitionLevel, isListLike, isMapLike } from "./schema.mjs";
2
+ import { decodeVariantColumn } from "./variant.mjs";
3
+ function assembleLists(output, definitionLevels, repetitionLevels, values, schemaPath) {
4
+ const maxDefinitionLevel = getMaxDefinitionLevel(schemaPath);
5
+ if (!definitionLevels?.length && !repetitionLevels.length) {
6
+ if (!maxDefinitionLevel || !values.length) return values;
7
+ definitionLevels = new Array(values.length).fill(maxDefinitionLevel);
8
+ }
9
+ const n = definitionLevels?.length || repetitionLevels.length;
10
+ const repetitionPath = schemaPath.map(({ element }) => element.repetition_type);
11
+ let valueIndex = 0;
12
+ const containerStack = [output];
13
+ let currentContainer = output;
14
+ let currentDepth = 0;
15
+ let currentDefLevel = 0;
16
+ let currentRepLevel = 0;
17
+ if (repetitionLevels[0]) while (currentDepth < repetitionPath.length - 2 && currentRepLevel < repetitionLevels[0]) {
18
+ currentDepth++;
19
+ if (repetitionPath[currentDepth] !== "REQUIRED") {
20
+ currentContainer = currentContainer.at(-1);
21
+ containerStack.push(currentContainer);
22
+ currentDefLevel++;
23
+ }
24
+ if (repetitionPath[currentDepth] === "REPEATED") currentRepLevel++;
25
+ }
26
+ for (let i = 0; i < n; i++) {
27
+ const def = definitionLevels?.length ? definitionLevels[i] : maxDefinitionLevel;
28
+ const rep = repetitionLevels[i];
29
+ while (currentDepth && (rep < currentRepLevel || repetitionPath[currentDepth] !== "REPEATED")) {
30
+ if (repetitionPath[currentDepth] !== "REQUIRED") {
31
+ containerStack.pop();
32
+ currentDefLevel--;
33
+ }
34
+ if (repetitionPath[currentDepth] === "REPEATED") currentRepLevel--;
35
+ currentDepth--;
36
+ }
37
+ currentContainer = containerStack.at(-1);
38
+ while ((currentDepth < repetitionPath.length - 2 || repetitionPath[currentDepth + 1] === "REPEATED") && (currentDefLevel < def || repetitionPath[currentDepth + 1] === "REQUIRED")) {
39
+ currentDepth++;
40
+ if (repetitionPath[currentDepth] !== "REQUIRED") {
41
+ const newList = [];
42
+ currentContainer.push(newList);
43
+ currentContainer = newList;
44
+ containerStack.push(newList);
45
+ currentDefLevel++;
46
+ }
47
+ if (repetitionPath[currentDepth] === "REPEATED") currentRepLevel++;
48
+ }
49
+ if (def === maxDefinitionLevel) currentContainer.push(values[valueIndex++]);
50
+ else if (currentDepth === repetitionPath.length - 2) currentContainer.push(null);
51
+ else currentContainer.push([]);
52
+ }
53
+ if (!output.length) for (let i = 0; i < maxDefinitionLevel; i++) {
54
+ const newList = [];
55
+ currentContainer.push(newList);
56
+ currentContainer = newList;
57
+ }
58
+ return output;
59
+ }
60
+ function assembleNested(subcolumnData, schema, parsers, depth = 0) {
61
+ const path = schema.path.join(".");
62
+ const optional = schema.element.repetition_type === "OPTIONAL";
63
+ const nextDepth = optional ? depth + 1 : depth;
64
+ if (isListLike(schema)) {
65
+ let sublist = schema.children[0];
66
+ let subDepth = nextDepth;
67
+ if (sublist.children.length === 1) {
68
+ sublist = sublist.children[0];
69
+ subDepth++;
70
+ }
71
+ assembleNested(subcolumnData, sublist, parsers, subDepth);
72
+ const subcolumn = sublist.path.join(".");
73
+ const values = subcolumnData.get(subcolumn);
74
+ if (!values) throw new Error("parquet list column missing values");
75
+ if (optional) flattenAtDepth(values, depth);
76
+ subcolumnData.set(path, values);
77
+ subcolumnData.delete(subcolumn);
78
+ return;
79
+ }
80
+ if (isMapLike(schema)) {
81
+ const mapName = schema.children[0].element.name;
82
+ assembleNested(subcolumnData, schema.children[0].children[0], parsers, nextDepth + 1);
83
+ assembleNested(subcolumnData, schema.children[0].children[1], parsers, nextDepth + 1);
84
+ const keys = subcolumnData.get(`${path}.${mapName}.key`);
85
+ const values = subcolumnData.get(`${path}.${mapName}.value`);
86
+ if (!keys) throw new Error("parquet map column missing keys");
87
+ if (!values) throw new Error("parquet map column missing values");
88
+ if (keys.length !== values.length) throw new Error("parquet map column key/value length mismatch");
89
+ const out = assembleMaps(keys, values, nextDepth);
90
+ if (optional) flattenAtDepth(out, depth);
91
+ subcolumnData.delete(`${path}.${mapName}.key`);
92
+ subcolumnData.delete(`${path}.${mapName}.value`);
93
+ subcolumnData.set(path, out);
94
+ return;
95
+ }
96
+ if (schema.children.length) {
97
+ const invertDepth = schema.element.repetition_type === "REQUIRED" ? depth : depth + 1;
98
+ const struct = {};
99
+ for (const child of schema.children) {
100
+ assembleNested(subcolumnData, child, parsers, invertDepth);
101
+ const childData = subcolumnData.get(child.path.join("."));
102
+ if (!childData) throw new Error("parquet struct missing child data");
103
+ struct[child.element.name] = childData;
104
+ }
105
+ for (const child of schema.children) subcolumnData.delete(child.path.join("."));
106
+ let inverted = invertStruct(struct, invertDepth);
107
+ if (schema.element.logical_type?.type === "VARIANT") inverted = decodeVariantColumn(inverted, parsers);
108
+ if (optional) flattenAtDepth(inverted, depth);
109
+ subcolumnData.set(path, inverted);
110
+ }
111
+ }
112
+ function flattenAtDepth(arr, depth) {
113
+ for (let i = 0; i < arr.length; i++) if (depth) flattenAtDepth(arr[i], depth - 1);
114
+ else arr[i] = arr[i][0];
115
+ }
116
+ function assembleMaps(keys, values, depth) {
117
+ const out = [];
118
+ for (let i = 0; i < keys.length; i++) if (depth) out.push(assembleMaps(keys[i], values[i], depth - 1));
119
+ else if (keys[i]) {
120
+ const obj = {};
121
+ for (let j = 0; j < keys[i].length; j++) {
122
+ const value = values[i][j];
123
+ obj[keys[i][j]] = value === void 0 ? null : value;
124
+ }
125
+ out.push(obj);
126
+ } else out.push(void 0);
127
+ return out;
128
+ }
129
+ function invertStruct(struct, depth) {
130
+ const keys = Object.keys(struct);
131
+ const length = struct[keys[0]]?.length;
132
+ const out = [];
133
+ for (let i = 0; i < length; i++) {
134
+ const obj = {};
135
+ for (const key of keys) {
136
+ if (struct[key].length !== length) throw new Error("parquet struct parsing error");
137
+ obj[key] = struct[key][i];
138
+ }
139
+ if (depth) out.push(invertStruct(obj, depth - 1));
140
+ else out.push(obj);
141
+ }
142
+ return out;
143
+ }
144
+ export { assembleLists, assembleNested };
@@ -0,0 +1,124 @@
1
+ import { deserializeTCompactProtocol } from "./thrift.mjs";
2
+ import { xxhash64 } from "./xxhash.mjs";
3
+ const textEncoder = new TextEncoder();
4
+ const SALT = new Uint32Array([
5
+ 1203114875,
6
+ 1150766481,
7
+ 2284105051,
8
+ 2729912477,
9
+ 1884591559,
10
+ 770785867,
11
+ 2667333959,
12
+ 1550580529
13
+ ]);
14
+ function blockIndex(hash, numBlocks) {
15
+ return Number((hash >> 32n) * BigInt(numBlocks) >> 32n);
16
+ }
17
+ function blockMask(hash) {
18
+ const m = /* @__PURE__ */ new Uint32Array(8);
19
+ const low = Number(hash & 4294967295n) | 0;
20
+ for (let i = 0; i < 8; i++) m[i] = 1 << (Math.imul(low, SALT[i]) >>> 27);
21
+ return m;
22
+ }
23
+ function sbbfContains(blocks, hash) {
24
+ const offset = blockIndex(hash, blocks.length >> 3) << 3;
25
+ const m = blockMask(hash);
26
+ for (let i = 0; i < 8; i++) if ((blocks[offset + i] & m[i]) === 0) return false;
27
+ return true;
28
+ }
29
+ function readBloomFilter(reader) {
30
+ const header = deserializeTCompactProtocol(reader);
31
+ const numBytes = header.field_1;
32
+ if (typeof numBytes !== "number" || numBytes <= 0 || numBytes % 32 !== 0) return void 0;
33
+ if (!header.field_2?.field_1) return void 0;
34
+ if (!header.field_3?.field_1) return void 0;
35
+ if (!header.field_4?.field_1) return void 0;
36
+ const { view, offset } = reader;
37
+ if (offset + numBytes > view.byteLength) throw new Error(`parquet bloom filter truncated: need ${numBytes} bytes, have ${view.byteLength - offset}`);
38
+ const blocks = new Uint32Array(numBytes >> 2);
39
+ for (let i = 0; i < blocks.length; i++) blocks[i] = view.getUint32(offset + i * 4, true);
40
+ reader.offset = offset + numBytes;
41
+ return {
42
+ numBytes,
43
+ blocks
44
+ };
45
+ }
46
+ function hashParquetValue(value, element) {
47
+ if (value === null || value === void 0) return void 0;
48
+ const { type, converted_type, logical_type } = element;
49
+ if (type === "BOOLEAN") {
50
+ if (typeof value !== "boolean") return void 0;
51
+ return xxhash64(new Uint8Array([value ? 1 : 0]));
52
+ }
53
+ if (type === "FLOAT") {
54
+ if (typeof value !== "number") return void 0;
55
+ const buf = /* @__PURE__ */ new ArrayBuffer(4);
56
+ new DataView(buf).setFloat32(0, value, true);
57
+ return xxhash64(new Uint8Array(buf));
58
+ }
59
+ if (type === "DOUBLE") {
60
+ if (typeof value !== "number") return void 0;
61
+ const buf = /* @__PURE__ */ new ArrayBuffer(8);
62
+ new DataView(buf).setFloat64(0, value, true);
63
+ return xxhash64(new Uint8Array(buf));
64
+ }
65
+ if (type === "INT32") {
66
+ if (converted_type === "DATE" || converted_type === "DECIMAL" || converted_type === "TIME_MILLIS") return void 0;
67
+ if (logical_type?.type === "DATE" || logical_type?.type === "TIME" || logical_type?.type === "DECIMAL") return void 0;
68
+ if (typeof value !== "number" || !Number.isInteger(value)) return void 0;
69
+ const buf = /* @__PURE__ */ new ArrayBuffer(4);
70
+ new DataView(buf).setInt32(0, value | 0, true);
71
+ return xxhash64(new Uint8Array(buf));
72
+ }
73
+ if (type === "INT64") {
74
+ if (converted_type === "TIMESTAMP_MILLIS" || converted_type === "TIMESTAMP_MICROS") return void 0;
75
+ if (converted_type === "TIME_MICROS" || converted_type === "DECIMAL") return void 0;
76
+ if (logical_type?.type === "TIMESTAMP" || logical_type?.type === "TIME" || logical_type?.type === "DECIMAL") return void 0;
77
+ let bigValue;
78
+ if (typeof value === "bigint") bigValue = value;
79
+ else if (typeof value === "number" && Number.isSafeInteger(value)) bigValue = BigInt(value);
80
+ else return void 0;
81
+ const buf = /* @__PURE__ */ new ArrayBuffer(8);
82
+ new DataView(buf).setBigUint64(0, BigInt.asUintN(64, bigValue), true);
83
+ return xxhash64(new Uint8Array(buf));
84
+ }
85
+ if (type === "BYTE_ARRAY") {
86
+ if (converted_type === "JSON" || converted_type === "BSON" || converted_type === "DECIMAL") return void 0;
87
+ if (logical_type?.type === "JSON" || logical_type?.type === "BSON" || logical_type?.type === "VARIANT") return void 0;
88
+ if (logical_type?.type === "GEOMETRY" || logical_type?.type === "GEOGRAPHY") return void 0;
89
+ if (typeof value === "string") return xxhash64(textEncoder.encode(value));
90
+ if (value instanceof Uint8Array) return xxhash64(value);
91
+ return;
92
+ }
93
+ if (type === "FIXED_LEN_BYTE_ARRAY") {
94
+ if (converted_type === "DECIMAL" || converted_type === "INTERVAL") return void 0;
95
+ if (logical_type?.type === "DECIMAL" || logical_type?.type === "UUID" || logical_type?.type === "FLOAT16") return void 0;
96
+ if (logical_type?.type === "GEOMETRY" || logical_type?.type === "GEOGRAPHY") return void 0;
97
+ if (value instanceof Uint8Array) return xxhash64(value);
98
+ return;
99
+ }
100
+ }
101
+ function bloomEligibleColumns(filter) {
102
+ const out = /* @__PURE__ */ new Set();
103
+ walkBloomEligible(filter, out);
104
+ return out;
105
+ }
106
+ function walkBloomEligible(filter, out) {
107
+ if (!filter) return;
108
+ if ("$and" in filter && Array.isArray(filter.$and)) {
109
+ for (const sub of filter.$and) walkBloomEligible(sub, out);
110
+ return;
111
+ }
112
+ if ("$or" in filter && Array.isArray(filter.$or)) {
113
+ for (const sub of filter.$or) walkBloomEligible(sub, out);
114
+ return;
115
+ }
116
+ if ("$nor" in filter) return;
117
+ for (const [field, condition] of Object.entries(filter)) {
118
+ if (field.startsWith("$")) continue;
119
+ if (typeof condition === "object" && condition !== null && !Array.isArray(condition)) {
120
+ if ("$eq" in condition || "$in" in condition) out.add(field);
121
+ } else out.add(field);
122
+ }
123
+ }
124
+ export { bloomEligibleColumns, hashParquetValue, readBloomFilter, sbbfContains };
@@ -0,0 +1,127 @@
1
+ import { Encodings, PageTypes } from "./constants.mjs";
2
+ import { convert, convertWithDictionary } from "./convert.mjs";
3
+ import { isFlatColumn } from "./schema.mjs";
4
+ import { deserializeTCompactProtocol } from "./thrift.mjs";
5
+ import { assembleLists } from "./assemble.mjs";
6
+ import { readPlain } from "./plain.mjs";
7
+ import { decompressPage, readDataPage, readDataPageV2 } from "./datapage.mjs";
8
+ function readColumn(reader, { groupStart, selectStart, selectEnd }, columnDecoder, onPage) {
9
+ const { pathInSchema, schemaPath } = columnDecoder;
10
+ const isFlat = isFlatColumn(schemaPath);
11
+ const chunks = [];
12
+ let dictionary = void 0;
13
+ let lastChunk = void 0;
14
+ let rowCount = 0;
15
+ let skipped = 0;
16
+ const emitLastChunk = onPage && (() => {
17
+ lastChunk && onPage({
18
+ pathInSchema,
19
+ columnData: lastChunk,
20
+ rowStart: groupStart + rowCount - lastChunk.length,
21
+ rowEnd: groupStart + rowCount
22
+ });
23
+ });
24
+ while (isFlat ? rowCount < selectEnd : reader.offset < reader.view.byteLength - 1) {
25
+ if (reader.offset >= reader.view.byteLength - 1) break;
26
+ const header = parquetHeader(reader);
27
+ if (header.type === "DICTIONARY_PAGE") {
28
+ const { data } = readPage(reader, header, columnDecoder, dictionary, void 0, 0);
29
+ if (data) dictionary = convert(data, columnDecoder);
30
+ } else {
31
+ const lastChunkLength = lastChunk?.length || 0;
32
+ const result = readPage(reader, header, columnDecoder, dictionary, lastChunk, selectStart - rowCount);
33
+ if (result.skipped) {
34
+ if (!chunks.length) skipped += result.skipped;
35
+ rowCount += result.skipped;
36
+ } else if (result.data && lastChunk === result.data) rowCount += result.data.length - lastChunkLength;
37
+ else if (result.data && result.data.length) {
38
+ emitLastChunk?.();
39
+ chunks.push(result.data);
40
+ rowCount += result.data.length;
41
+ lastChunk = result.data;
42
+ }
43
+ }
44
+ }
45
+ emitLastChunk?.();
46
+ return {
47
+ data: chunks,
48
+ skipped
49
+ };
50
+ }
51
+ function readPage(reader, header, columnDecoder, dictionary, previousChunk, pageStart) {
52
+ const { type, element, schemaPath, codec, compressors } = columnDecoder;
53
+ const compressedBytes = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, header.compressed_page_size);
54
+ reader.offset += header.compressed_page_size;
55
+ if (header.type === "DATA_PAGE") {
56
+ const daph = header.data_page_header;
57
+ if (!daph) throw new Error("parquet data page header is undefined");
58
+ if (pageStart > daph.num_values && isFlatColumn(schemaPath)) return { skipped: daph.num_values };
59
+ const { definitionLevels, repetitionLevels, dataPage } = readDataPage(decompressPage(compressedBytes, Number(header.uncompressed_page_size), codec, compressors), daph, columnDecoder);
60
+ const values = convertWithDictionary(dataPage, dictionary, daph.encoding, columnDecoder);
61
+ return {
62
+ skipped: 0,
63
+ data: assembleLists(Array.isArray(previousChunk) ? previousChunk : [], definitionLevels, repetitionLevels, values, schemaPath)
64
+ };
65
+ } else if (header.type === "DATA_PAGE_V2") {
66
+ const daph2 = header.data_page_header_v2;
67
+ if (!daph2) throw new Error("parquet data page header v2 is undefined");
68
+ if (pageStart > daph2.num_rows) return { skipped: daph2.num_values };
69
+ const { definitionLevels, repetitionLevels, dataPage } = readDataPageV2(compressedBytes, header, columnDecoder);
70
+ const values = convertWithDictionary(dataPage, dictionary, daph2.encoding, columnDecoder);
71
+ return {
72
+ skipped: 0,
73
+ data: assembleLists(Array.isArray(previousChunk) ? previousChunk : [], definitionLevels, repetitionLevels, values, schemaPath)
74
+ };
75
+ } else if (header.type === "DICTIONARY_PAGE") {
76
+ const diph = header.dictionary_page_header;
77
+ if (!diph) throw new Error("parquet dictionary page header is undefined");
78
+ const page = decompressPage(compressedBytes, Number(header.uncompressed_page_size), codec, compressors);
79
+ return {
80
+ skipped: 0,
81
+ data: readPlain({
82
+ view: new DataView(page.buffer, page.byteOffset, page.byteLength),
83
+ offset: 0
84
+ }, type, diph.num_values, element.type_length)
85
+ };
86
+ } else throw new Error(`parquet unsupported page type: ${header.type}`);
87
+ }
88
+ function parquetHeader(reader) {
89
+ const header = deserializeTCompactProtocol(reader);
90
+ return {
91
+ type: PageTypes[header.field_1],
92
+ uncompressed_page_size: header.field_2,
93
+ compressed_page_size: header.field_3,
94
+ crc: header.field_4,
95
+ data_page_header: header.field_5 && {
96
+ num_values: header.field_5.field_1,
97
+ encoding: Encodings[header.field_5.field_2],
98
+ definition_level_encoding: Encodings[header.field_5.field_3],
99
+ repetition_level_encoding: Encodings[header.field_5.field_4],
100
+ statistics: header.field_5.field_5 && {
101
+ max: header.field_5.field_5.field_1,
102
+ min: header.field_5.field_5.field_2,
103
+ null_count: header.field_5.field_5.field_3,
104
+ distinct_count: header.field_5.field_5.field_4,
105
+ max_value: header.field_5.field_5.field_5,
106
+ min_value: header.field_5.field_5.field_6
107
+ }
108
+ },
109
+ index_page_header: header.field_6,
110
+ dictionary_page_header: header.field_7 && {
111
+ num_values: header.field_7.field_1,
112
+ encoding: Encodings[header.field_7.field_2],
113
+ is_sorted: header.field_7.field_3
114
+ },
115
+ data_page_header_v2: header.field_8 && {
116
+ num_values: header.field_8.field_1,
117
+ num_nulls: header.field_8.field_2,
118
+ num_rows: header.field_8.field_3,
119
+ encoding: Encodings[header.field_8.field_4],
120
+ definition_levels_byte_length: header.field_8.field_5,
121
+ repetition_levels_byte_length: header.field_8.field_6,
122
+ is_compressed: header.field_8.field_7 === void 0 ? true : header.field_8.field_7,
123
+ statistics: header.field_8.field_8
124
+ }
125
+ };
126
+ }
127
+ export { readColumn, readPage };
@@ -0,0 +1,75 @@
1
+ const ParquetTypes = [
2
+ "BOOLEAN",
3
+ "INT32",
4
+ "INT64",
5
+ "INT96",
6
+ "FLOAT",
7
+ "DOUBLE",
8
+ "BYTE_ARRAY",
9
+ "FIXED_LEN_BYTE_ARRAY"
10
+ ];
11
+ const Encodings = [
12
+ "PLAIN",
13
+ "GROUP_VAR_INT",
14
+ "PLAIN_DICTIONARY",
15
+ "RLE",
16
+ "BIT_PACKED",
17
+ "DELTA_BINARY_PACKED",
18
+ "DELTA_LENGTH_BYTE_ARRAY",
19
+ "DELTA_BYTE_ARRAY",
20
+ "RLE_DICTIONARY",
21
+ "BYTE_STREAM_SPLIT"
22
+ ];
23
+ const FieldRepetitionTypes = [
24
+ "REQUIRED",
25
+ "OPTIONAL",
26
+ "REPEATED"
27
+ ];
28
+ const ConvertedTypes = [
29
+ "UTF8",
30
+ "MAP",
31
+ "MAP_KEY_VALUE",
32
+ "LIST",
33
+ "ENUM",
34
+ "DECIMAL",
35
+ "DATE",
36
+ "TIME_MILLIS",
37
+ "TIME_MICROS",
38
+ "TIMESTAMP_MILLIS",
39
+ "TIMESTAMP_MICROS",
40
+ "UINT_8",
41
+ "UINT_16",
42
+ "UINT_32",
43
+ "UINT_64",
44
+ "INT_8",
45
+ "INT_16",
46
+ "INT_32",
47
+ "INT_64",
48
+ "JSON",
49
+ "BSON",
50
+ "INTERVAL"
51
+ ];
52
+ const CompressionCodecs = [
53
+ "UNCOMPRESSED",
54
+ "SNAPPY",
55
+ "GZIP",
56
+ "LZO",
57
+ "BROTLI",
58
+ "LZ4",
59
+ "ZSTD",
60
+ "LZ4_RAW"
61
+ ];
62
+ const PageTypes = [
63
+ "DATA_PAGE",
64
+ "INDEX_PAGE",
65
+ "DICTIONARY_PAGE",
66
+ "DATA_PAGE_V2"
67
+ ];
68
+ const EdgeInterpolationAlgorithms = [
69
+ "SPHERICAL",
70
+ "VINCENTY",
71
+ "THOMAS",
72
+ "ANDOYER",
73
+ "KARNEY"
74
+ ];
75
+ export { CompressionCodecs, ConvertedTypes, EdgeInterpolationAlgorithms, Encodings, FieldRepetitionTypes, PageTypes, ParquetTypes };
@@ -0,0 +1,118 @@
1
+ import { wkbToGeojson } from "./wkb.mjs";
2
+ const decoder = new TextDecoder();
3
+ const DEFAULT_PARSERS = {
4
+ timestampFromMilliseconds(millis) {
5
+ return new Date(Number(millis));
6
+ },
7
+ timestampFromMicroseconds(micros) {
8
+ return new Date(Number(micros / 1000n));
9
+ },
10
+ timestampFromNanoseconds(nanos) {
11
+ return new Date(Number(nanos / 1000000n));
12
+ },
13
+ dateFromDays(days) {
14
+ return /* @__PURE__ */ new Date(days * 864e5);
15
+ },
16
+ stringFromBytes(bytes) {
17
+ return bytes && decoder.decode(bytes);
18
+ },
19
+ jsonFromBytes(bytes) {
20
+ return bytes && JSON.parse(decoder.decode(bytes));
21
+ },
22
+ geometryFromBytes(bytes) {
23
+ return bytes && wkbToGeojson({
24
+ view: new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength),
25
+ offset: 0
26
+ });
27
+ },
28
+ geographyFromBytes(bytes) {
29
+ return bytes && wkbToGeojson({
30
+ view: new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength),
31
+ offset: 0
32
+ });
33
+ },
34
+ uuidFromBytes(bytes) {
35
+ if (!bytes) return void 0;
36
+ const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
37
+ return hex.slice(0, 8) + "-" + hex.slice(8, 12) + "-" + hex.slice(12, 16) + "-" + hex.slice(16, 20) + "-" + hex.slice(20, 32);
38
+ }
39
+ };
40
+ function convertWithDictionary(data, dictionary, encoding, columnDecoder) {
41
+ if (dictionary && encoding.endsWith("_DICTIONARY")) {
42
+ let output = data;
43
+ if (data instanceof Uint8Array && !(dictionary instanceof Uint8Array)) output = new dictionary.constructor(data.length);
44
+ for (let i = 0; i < data.length; i++) output[i] = dictionary[data[i]];
45
+ return output;
46
+ } else return convert(data, columnDecoder);
47
+ }
48
+ function convert(data, columnDecoder) {
49
+ const { element, parsers, utf8 = true, schemaPath } = columnDecoder;
50
+ const { type, converted_type: ctype, logical_type: ltype } = element;
51
+ const nullable = element.repetition_type !== "REQUIRED";
52
+ if (schemaPath?.some((s) => s.element.logical_type?.type === "VARIANT") && type === "BYTE_ARRAY" && ctype !== "UTF8" && ltype?.type !== "STRING") return data;
53
+ if (ctype === "DECIMAL") {
54
+ const factor = 10 ** -(element.scale || 0);
55
+ const arr = new Array(data.length);
56
+ for (let i = 0; i < arr.length; i++) if (data[i] instanceof Uint8Array) arr[i] = parseDecimal(data[i]) * factor;
57
+ else arr[i] = Number(data[i]) * factor;
58
+ return arr;
59
+ }
60
+ if (!ctype && type === "INT96") return Array.from(data).map((v) => parsers.timestampFromNanoseconds(parseInt96Nanos(v)));
61
+ if (ctype === "DATE") return Array.from(data).map((v) => parsers.dateFromDays(v));
62
+ if (ctype === "TIMESTAMP_MILLIS") return Array.from(data).map((v) => parsers.timestampFromMilliseconds(v));
63
+ if (ctype === "TIMESTAMP_MICROS") return Array.from(data).map((v) => parsers.timestampFromMicroseconds(v));
64
+ if (ctype === "JSON") return data.map((v) => parsers.jsonFromBytes(v));
65
+ if (ctype === "BSON") throw new Error("parquet bson not supported");
66
+ if (ctype === "INTERVAL") throw new Error("parquet interval not supported");
67
+ if (ltype?.type === "GEOMETRY") return data.map((v) => parsers.geometryFromBytes(v));
68
+ if (ltype?.type === "GEOGRAPHY") return data.map((v) => parsers.geographyFromBytes(v));
69
+ if (ltype?.type === "UUID") return data.map((v) => parsers.uuidFromBytes(v));
70
+ if (ctype === "UTF8" || ltype?.type === "STRING" || utf8 && type === "BYTE_ARRAY") return data.map((v) => parsers.stringFromBytes(v));
71
+ if (ctype === "UINT_64" || ltype?.type === "INTEGER" && ltype.bitWidth === 64 && !ltype.isSigned) {
72
+ if (data instanceof BigInt64Array) return new BigUint64Array(data.buffer, data.byteOffset, data.length);
73
+ const arr = nullable ? new Array(data.length) : new BigUint64Array(data.length);
74
+ for (let i = 0; i < arr.length; i++) arr[i] = data[i];
75
+ return arr;
76
+ }
77
+ if (ctype === "UINT_32" || ltype?.type === "INTEGER" && ltype.bitWidth === 32 && !ltype.isSigned) {
78
+ if (data instanceof Int32Array) return new Uint32Array(data.buffer, data.byteOffset, data.length);
79
+ const arr = nullable ? new Array(data.length) : new Uint32Array(data.length);
80
+ for (let i = 0; i < arr.length; i++) arr[i] = data[i] < 0 ? 4294967296 + data[i] : data[i];
81
+ return arr;
82
+ }
83
+ if (ltype?.type === "FLOAT16") return Array.from(data).map(parseFloat16);
84
+ if (ltype?.type === "TIMESTAMP") {
85
+ const { unit } = ltype;
86
+ let parser = parsers.timestampFromMilliseconds;
87
+ if (unit === "MICROS") parser = parsers.timestampFromMicroseconds;
88
+ if (unit === "NANOS") parser = parsers.timestampFromNanoseconds;
89
+ const arr = new Array(data.length);
90
+ for (let i = 0; i < arr.length; i++) arr[i] = parser(data[i]);
91
+ return arr;
92
+ }
93
+ return data;
94
+ }
95
+ function parseDecimal(bytes) {
96
+ if (!bytes.length) return 0;
97
+ let value = 0n;
98
+ for (const byte of bytes) value = value * 256n + BigInt(byte);
99
+ const bits = bytes.length * 8;
100
+ if (value >= 2n ** BigInt(bits - 1)) value -= 2n ** BigInt(bits);
101
+ return Number(value);
102
+ }
103
+ function parseInt96Nanos(value) {
104
+ const days = (value >> 64n) - 2440588n;
105
+ const nano = value & 18446744073709551615n;
106
+ return days * 86400000000000n + nano;
107
+ }
108
+ function parseFloat16(bytes) {
109
+ if (!bytes) return void 0;
110
+ const int16 = bytes[1] << 8 | bytes[0];
111
+ const sign = int16 >> 15 ? -1 : 1;
112
+ const exp = int16 >> 10 & 31;
113
+ const frac = int16 & 1023;
114
+ if (exp === 0) return sign * 2 ** -14 * (frac / 1024);
115
+ if (exp === 31) return frac ? NaN : sign * Infinity;
116
+ return sign * 2 ** (exp - 15) * (1 + frac / 1024);
117
+ }
118
+ export { DEFAULT_PARSERS, convert, convertWithDictionary, parseDecimal, parseFloat16 };