@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,116 @@
1
+ import { getMaxDefinitionLevel, isListLike, isMapLike } from "../../../../hyparquet@1.26.1/node_modules/hyparquet/src/schema.mjs";
2
+ function encodeNestedValues(treePath, rows) {
3
+ const schemaPath = treePath.map((n) => n.element);
4
+ if (treePath.length < 2) throw new Error("parquet schema path must include column");
5
+ const definitionLevels = [];
6
+ const repetitionLevels = [];
7
+ const maxDefinitionLevel = getMaxDefinitionLevel(treePath);
8
+ if (treePath.length === 2 && maxDefinitionLevel === 0) return {
9
+ values: rows,
10
+ definitionLevels,
11
+ repetitionLevels,
12
+ maxDefinitionLevel
13
+ };
14
+ if (treePath.length === 2 && maxDefinitionLevel === 1) {
15
+ const definitionLevels = new Array(rows.length);
16
+ for (let i = 0; i < rows.length; i++) definitionLevels[i] = rows[i] === null || rows[i] === void 0 ? 0 : 1;
17
+ return {
18
+ values: rows,
19
+ definitionLevels,
20
+ repetitionLevels,
21
+ maxDefinitionLevel
22
+ };
23
+ }
24
+ const repLevelPrior = new Array(treePath.length);
25
+ let repeatedCount = 0;
26
+ for (let i = 0; i < treePath.length; i++) {
27
+ repLevelPrior[i] = repeatedCount;
28
+ if (schemaPath[i].repetition_type === "REPEATED") repeatedCount++;
29
+ }
30
+ const values = [];
31
+ for (const row of rows) visit(1, row, 0, 0, false);
32
+ return {
33
+ values,
34
+ definitionLevels,
35
+ repetitionLevels,
36
+ maxDefinitionLevel
37
+ };
38
+ function visit(depth, value, defLevel, repLevel, allowNull) {
39
+ const element = schemaPath[depth];
40
+ const repetition = element.repetition_type || "REQUIRED";
41
+ if (depth === treePath.length - 1) {
42
+ if (value === null || value === void 0) {
43
+ if (repetition === "REQUIRED" && !allowNull) throw new Error("parquet required value is undefined");
44
+ definitionLevels.push(defLevel);
45
+ } else definitionLevels.push(repetition === "REQUIRED" ? defLevel : defLevel + 1);
46
+ repetitionLevels.push(repLevel);
47
+ values.push(value);
48
+ return;
49
+ }
50
+ if (repetition === "REPEATED") {
51
+ if (value === null || value === void 0) {
52
+ if (!allowNull) throw new Error("parquet required value is undefined");
53
+ visit(depth + 1, void 0, defLevel, repLevel, true);
54
+ return;
55
+ }
56
+ if (!Array.isArray(value)) throw new Error(`parquet repeated field ${element.name} must be an array`);
57
+ if (!value.length) {
58
+ visit(depth + 1, void 0, defLevel, repLevel, true);
59
+ return;
60
+ }
61
+ const isMapEntry = isMapLike(treePath[depth - 1]);
62
+ const childElement = schemaPath[depth + 1];
63
+ for (let i = 0; i < value.length; i++) {
64
+ let childValue = value[i];
65
+ if (isMapEntry && childValue && typeof childValue === "object" && childElement) childValue = childValue[childElement.name];
66
+ const childRep = i === 0 ? repLevel : repLevelPrior[depth] + 1;
67
+ visit(depth + 1, childValue, defLevel + 1, childRep, false);
68
+ }
69
+ return;
70
+ }
71
+ if (repetition === "OPTIONAL") {
72
+ if (value === null || value === void 0) visit(depth + 1, void 0, defLevel, repLevel, true);
73
+ else {
74
+ const childValue = getChildValue(depth, value);
75
+ const childIsNull = childValue === null || childValue === void 0;
76
+ const isLogicalContainer = isListLike(treePath[depth]) || isMapLike(treePath[depth]);
77
+ const nextDef = element.num_children && !element.type && !isLogicalContainer || !childIsNull ? defLevel + 1 : defLevel;
78
+ visit(depth + 1, childValue, nextDef, repLevel, childIsNull);
79
+ }
80
+ return;
81
+ }
82
+ if (value === null || value === void 0) {
83
+ if (!allowNull) throw new Error("parquet required value is undefined");
84
+ visit(depth + 1, void 0, defLevel, repLevel, true);
85
+ } else visit(depth + 1, getChildValue(depth, value), defLevel, repLevel, false);
86
+ }
87
+ function getChildValue(depth, currentValue) {
88
+ if (currentValue === null || currentValue === void 0) return void 0;
89
+ const child = schemaPath[depth + 1];
90
+ if (!child) return void 0;
91
+ if (isListLike(treePath[depth])) return currentValue;
92
+ if (isMapLike(treePath[depth])) return normalizeMap(currentValue, schemaPath[depth]);
93
+ if (typeof currentValue === "object" && !Array.isArray(currentValue)) return currentValue[child.name];
94
+ throw new Error(`parquet expected struct, got ${currentValue}`);
95
+ }
96
+ }
97
+ function normalizeMap(value, element) {
98
+ if (value instanceof Map) return Array.from(value.entries(), ([k, v]) => ({
99
+ key: k,
100
+ value: v
101
+ }));
102
+ if (Array.isArray(value)) return value.map((entry) => {
103
+ if (entry && typeof entry === "object" && "key" in entry && "value" in entry) return entry;
104
+ if (Array.isArray(entry) && entry.length === 2) return {
105
+ key: entry[0],
106
+ value: entry[1]
107
+ };
108
+ throw new Error("parquet map entry must provide key and value");
109
+ });
110
+ if (typeof value === "object") return Object.entries(value).map(([k, v]) => ({
111
+ key: k,
112
+ value: v
113
+ }));
114
+ throw new Error(`parquet map field ${element.name} must be Map, array, or object`);
115
+ }
116
+ export { encodeNestedValues };
@@ -0,0 +1,51 @@
1
+ function writeRleBitPackedHybrid(writer, values, bitWidth) {
2
+ const offsetStart = writer.offset;
3
+ let pendingBitPackedGroups = 0;
4
+ let bitPackedStart = 0;
5
+ let i = 0;
6
+ while (i < values.length) {
7
+ let rleCount = 1;
8
+ const firstVal = values[i];
9
+ while (i + rleCount < values.length && values[i + rleCount] === firstVal) rleCount++;
10
+ if (rleCount >= 8) {
11
+ if (pendingBitPackedGroups) {
12
+ writeBitPackedGroups(writer, values, bitPackedStart, pendingBitPackedGroups, bitWidth);
13
+ pendingBitPackedGroups = 0;
14
+ }
15
+ writeRleRun(writer, firstVal, rleCount, bitWidth);
16
+ i += rleCount;
17
+ } else {
18
+ if (pendingBitPackedGroups === 0) bitPackedStart = i;
19
+ pendingBitPackedGroups++;
20
+ i += 8;
21
+ }
22
+ }
23
+ if (pendingBitPackedGroups) writeBitPackedGroups(writer, values, bitPackedStart, pendingBitPackedGroups, bitWidth);
24
+ return writer.offset - offsetStart;
25
+ }
26
+ function writeRleRun(writer, value, count, bitWidth) {
27
+ writer.appendVarInt(count << 1);
28
+ const width = bitWidth + 7 >> 3;
29
+ for (let j = 0; j < width; j++) writer.appendUint8(value >> (j << 3) & 255);
30
+ }
31
+ function writeBitPackedGroups(writer, values, start, numGroups, bitWidth) {
32
+ writer.appendVarInt(numGroups << 1 | 1);
33
+ if (bitWidth === 0) return;
34
+ const mask = (1 << bitWidth) - 1;
35
+ let buffer = 0;
36
+ let bitsUsed = 0;
37
+ const totalValues = numGroups * 8;
38
+ for (let i = 0; i < totalValues; i++) {
39
+ const idx = start + i;
40
+ const v = idx < values.length ? values[idx] & mask : 0;
41
+ buffer |= v << bitsUsed;
42
+ bitsUsed += bitWidth;
43
+ while (bitsUsed >= 8) {
44
+ writer.appendUint8(buffer & 255);
45
+ buffer >>>= 8;
46
+ bitsUsed -= 8;
47
+ }
48
+ }
49
+ if (bitsUsed > 0) writer.appendUint8(buffer & 255);
50
+ }
51
+ export { writeRleBitPackedHybrid };
@@ -0,0 +1,84 @@
1
+ function geospatialStatistics(values) {
2
+ const typeCodes = /* @__PURE__ */ new Set();
3
+ let partial;
4
+ for (const value of values) {
5
+ if (value === null || value === void 0) continue;
6
+ if (typeof value !== "object") throw new Error("geospatial column expects GeoJSON geometries");
7
+ partial = extendBoundsFromGeometry(partial, value);
8
+ typeCodes.add(geometryTypeCodeWithDimension(value));
9
+ }
10
+ let bbox;
11
+ const { xmin, ymin, xmax, ymax } = partial ?? {};
12
+ if (xmin !== void 0 && ymin !== void 0 && xmax !== void 0 && ymax !== void 0) bbox = {
13
+ ...partial,
14
+ xmin,
15
+ ymin,
16
+ xmax,
17
+ ymax
18
+ };
19
+ if (typeCodes.size || bbox) return {
20
+ bbox,
21
+ geospatial_types: typeCodes.size ? Array.from(typeCodes).sort((a, b) => a - b) : []
22
+ };
23
+ }
24
+ function extendBoundsFromGeometry(bbox, geometry) {
25
+ if (geometry.type === "GeometryCollection") {
26
+ for (const child of geometry.geometries || []) bbox = extendBoundsFromGeometry(bbox, child);
27
+ return bbox;
28
+ }
29
+ return extendBoundsFromCoordinates(bbox, geometry.coordinates);
30
+ }
31
+ function extendBoundsFromCoordinates(bbox, coordinates) {
32
+ if (typeof coordinates[0] === "number") {
33
+ bbox = updateAxis(bbox, "xmin", "xmax", coordinates[0]);
34
+ bbox = updateAxis(bbox, "ymin", "ymax", coordinates[1]);
35
+ if (coordinates.length > 2) bbox = updateAxis(bbox, "zmin", "zmax", coordinates[2]);
36
+ if (coordinates.length > 3) bbox = updateAxis(bbox, "mmin", "mmax", coordinates[3]);
37
+ return bbox;
38
+ }
39
+ for (const child of coordinates) bbox = extendBoundsFromCoordinates(bbox, child);
40
+ return bbox;
41
+ }
42
+ function updateAxis(bbox, minKey, maxKey, value) {
43
+ if (value === void 0 || !Number.isFinite(value)) return bbox;
44
+ if (!bbox) bbox = {};
45
+ const min = bbox[minKey];
46
+ const max = bbox[maxKey];
47
+ if (min === void 0 || value < min) bbox[minKey] = value;
48
+ if (max === void 0 || value > max) bbox[maxKey] = value;
49
+ return bbox;
50
+ }
51
+ function geometryTypeCodeWithDimension(geometry) {
52
+ const base = geometryTypeCodes[geometry.type];
53
+ if (base === void 0) throw new Error(`unknown geometry type: ${geometry.type}`);
54
+ const dim = inferGeometryDimensions(geometry);
55
+ if (dim === 2) return base;
56
+ if (dim === 3) return base + 1e3;
57
+ if (dim === 4) return base + 3e3;
58
+ throw new Error(`unsupported geometry dimensions: ${dim}`);
59
+ }
60
+ const geometryTypeCodes = {
61
+ Point: 1,
62
+ LineString: 2,
63
+ Polygon: 3,
64
+ MultiPoint: 4,
65
+ MultiLineString: 5,
66
+ MultiPolygon: 6,
67
+ GeometryCollection: 7
68
+ };
69
+ function inferGeometryDimensions(geometry) {
70
+ if (geometry.type === "GeometryCollection") {
71
+ let maxDim = 0;
72
+ for (const child of geometry.geometries || []) maxDim = Math.max(maxDim, inferGeometryDimensions(child));
73
+ return maxDim || 2;
74
+ }
75
+ return inferCoordinateDimensions(geometry.coordinates);
76
+ }
77
+ function inferCoordinateDimensions(value) {
78
+ if (!value.length) return 2;
79
+ if (typeof value[0] === "number") return value.length;
80
+ let maxDim = 0;
81
+ for (const item of value) maxDim = Math.max(maxDim, inferCoordinateDimensions(item));
82
+ return maxDim || 2;
83
+ }
84
+ export { geospatialStatistics };
@@ -0,0 +1,7 @@
1
+ import { ByteWriter } from "./bytewriter.mjs";
2
+ import "./schema.mjs";
3
+ import "./wkb.mjs";
4
+ import "./parquet-writer.mjs";
5
+ import "./write.mjs";
6
+ import { parquetWriteRows } from "./write-rows.mjs";
7
+ export { ByteWriter, parquetWriteRows };
@@ -0,0 +1,31 @@
1
+ import { serializeTCompactProtocol } from "./thrift.mjs";
2
+ import { BoundaryOrders } from "../../../../hyparquet@1.26.1/node_modules/hyparquet/src/constants.mjs";
3
+ function writeIndexes(writer, pageIndexes) {
4
+ for (const { chunk, columnIndex } of pageIndexes) writeColumnIndex(writer, chunk, columnIndex);
5
+ for (const { chunk, offsetIndex } of pageIndexes) writeOffsetIndex(writer, chunk, offsetIndex);
6
+ }
7
+ function writeColumnIndex(writer, columnChunk, columnIndex) {
8
+ if (!columnIndex || columnIndex.min_values.length <= 1) return;
9
+ const columnIndexOffset = writer.offset;
10
+ serializeTCompactProtocol(writer, {
11
+ field_1: columnIndex.null_pages,
12
+ field_2: columnIndex.min_values,
13
+ field_3: columnIndex.max_values,
14
+ field_4: BoundaryOrders.indexOf(columnIndex.boundary_order),
15
+ field_5: columnIndex.null_counts
16
+ });
17
+ columnChunk.column_index_offset = BigInt(columnIndexOffset);
18
+ columnChunk.column_index_length = writer.offset - columnIndexOffset;
19
+ }
20
+ function writeOffsetIndex(writer, columnChunk, offsetIndex) {
21
+ if (!offsetIndex || offsetIndex.page_locations.length <= 1) return;
22
+ const offsetIndexOffset = writer.offset;
23
+ serializeTCompactProtocol(writer, { field_1: offsetIndex.page_locations.map((p) => ({
24
+ field_1: p.offset,
25
+ field_2: p.compressed_page_size,
26
+ field_3: p.first_row_index
27
+ })) });
28
+ columnChunk.offset_index_offset = BigInt(offsetIndexOffset);
29
+ columnChunk.offset_index_length = writer.offset - offsetIndexOffset;
30
+ }
31
+ export { writeIndexes };
@@ -0,0 +1,138 @@
1
+ import { getSchemaPath } from "../../../../hyparquet@1.26.1/node_modules/hyparquet/src/schema.mjs";
2
+ import { serializeTCompactProtocol } from "./thrift.mjs";
3
+ import { CompressionCodecs, ConvertedTypes, EdgeInterpolationAlgorithms, Encodings, FieldRepetitionTypes, PageTypes, ParquetTypes } from "../../../../hyparquet@1.26.1/node_modules/hyparquet/src/constants.mjs";
4
+ import { unconvertStatistics } from "./unconvert.mjs";
5
+ function writeMetadata(writer, metadata) {
6
+ const compact = {
7
+ field_1: metadata.version,
8
+ field_2: metadata.schema.map((element) => ({
9
+ field_1: element.type && ParquetTypes.indexOf(element.type),
10
+ field_2: element.type_length,
11
+ field_3: element.repetition_type && FieldRepetitionTypes.indexOf(element.repetition_type),
12
+ field_4: element.name,
13
+ field_5: element.num_children,
14
+ field_6: element.converted_type && ConvertedTypes.indexOf(element.converted_type),
15
+ field_7: element.scale,
16
+ field_8: element.precision,
17
+ field_9: element.field_id,
18
+ field_10: logicalType(element.logical_type)
19
+ })),
20
+ field_3: metadata.num_rows,
21
+ field_4: metadata.row_groups.map((rg) => ({
22
+ field_1: rg.columns.map((c) => ({
23
+ field_1: c.file_path,
24
+ field_2: c.file_offset,
25
+ field_3: c.meta_data && {
26
+ field_1: ParquetTypes.indexOf(c.meta_data.type),
27
+ field_2: c.meta_data.encodings.map((e) => Encodings.indexOf(e)),
28
+ field_3: c.meta_data.path_in_schema,
29
+ field_4: CompressionCodecs.indexOf(c.meta_data.codec),
30
+ field_5: c.meta_data.num_values,
31
+ field_6: c.meta_data.total_uncompressed_size,
32
+ field_7: c.meta_data.total_compressed_size,
33
+ field_8: c.meta_data.key_value_metadata && c.meta_data.key_value_metadata.map((kv) => ({
34
+ field_1: kv.key,
35
+ field_2: kv.value
36
+ })),
37
+ field_9: c.meta_data.data_page_offset,
38
+ field_10: c.meta_data.index_page_offset,
39
+ field_11: c.meta_data.dictionary_page_offset,
40
+ field_12: c.meta_data.statistics && unconvertStatistics(c.meta_data.statistics, schemaElement(metadata.schema, c.meta_data.path_in_schema)),
41
+ field_13: c.meta_data.encoding_stats && c.meta_data.encoding_stats.map((es) => ({
42
+ field_1: PageTypes.indexOf(es.page_type),
43
+ field_2: Encodings.indexOf(es.encoding),
44
+ field_3: es.count
45
+ })),
46
+ field_14: c.meta_data.bloom_filter_offset,
47
+ field_15: c.meta_data.bloom_filter_length,
48
+ field_16: c.meta_data.size_statistics && {
49
+ field_1: c.meta_data.size_statistics.unencoded_byte_array_data_bytes,
50
+ field_2: c.meta_data.size_statistics.repetition_level_histogram,
51
+ field_3: c.meta_data.size_statistics.definition_level_histogram
52
+ },
53
+ field_17: c.meta_data.geospatial_statistics && {
54
+ field_1: c.meta_data.geospatial_statistics.bbox && {
55
+ field_1: c.meta_data.geospatial_statistics.bbox.xmin,
56
+ field_2: c.meta_data.geospatial_statistics.bbox.xmax,
57
+ field_3: c.meta_data.geospatial_statistics.bbox.ymin,
58
+ field_4: c.meta_data.geospatial_statistics.bbox.ymax,
59
+ field_5: c.meta_data.geospatial_statistics.bbox.zmin,
60
+ field_6: c.meta_data.geospatial_statistics.bbox.zmax,
61
+ field_7: c.meta_data.geospatial_statistics.bbox.mmin,
62
+ field_8: c.meta_data.geospatial_statistics.bbox.mmax
63
+ },
64
+ field_2: c.meta_data.geospatial_statistics.geospatial_types
65
+ }
66
+ },
67
+ field_4: c.offset_index_offset,
68
+ field_5: c.offset_index_length,
69
+ field_6: c.column_index_offset,
70
+ field_7: c.column_index_length,
71
+ field_9: c.encrypted_column_metadata
72
+ })),
73
+ field_2: rg.total_byte_size,
74
+ field_3: rg.num_rows,
75
+ field_4: rg.sorting_columns && rg.sorting_columns.map((sc) => ({
76
+ field_1: sc.column_idx,
77
+ field_2: sc.descending,
78
+ field_3: sc.nulls_first
79
+ })),
80
+ field_5: rg.file_offset,
81
+ field_6: rg.total_compressed_size
82
+ })),
83
+ field_5: metadata.key_value_metadata && metadata.key_value_metadata.map((kv) => ({
84
+ field_1: kv.key,
85
+ field_2: kv.value
86
+ })),
87
+ field_6: metadata.created_by
88
+ };
89
+ const metadataStart = writer.offset;
90
+ serializeTCompactProtocol(writer, compact);
91
+ const metadataLength = writer.offset - metadataStart;
92
+ writer.appendUint32(metadataLength);
93
+ }
94
+ function schemaElement(schema, path) {
95
+ const tree = getSchemaPath(schema, path);
96
+ return tree[tree.length - 1].element;
97
+ }
98
+ function logicalType(type) {
99
+ if (!type) return;
100
+ if (type.type === "STRING") return { field_1: {} };
101
+ if (type.type === "MAP") return { field_2: {} };
102
+ if (type.type === "LIST") return { field_3: {} };
103
+ if (type.type === "ENUM") return { field_4: {} };
104
+ if (type.type === "DECIMAL") return { field_5: {
105
+ field_1: type.scale,
106
+ field_2: type.precision
107
+ } };
108
+ if (type.type === "DATE") return { field_6: {} };
109
+ if (type.type === "TIME") return { field_7: {
110
+ field_1: type.isAdjustedToUTC,
111
+ field_2: timeUnit(type.unit)
112
+ } };
113
+ if (type.type === "TIMESTAMP") return { field_8: {
114
+ field_1: type.isAdjustedToUTC,
115
+ field_2: timeUnit(type.unit)
116
+ } };
117
+ if (type.type === "INTEGER") return { field_10: {
118
+ field_1: type.bitWidth,
119
+ field_2: type.isSigned
120
+ } };
121
+ if (type.type === "NULL") return { field_11: {} };
122
+ if (type.type === "JSON") return { field_12: {} };
123
+ if (type.type === "BSON") return { field_13: {} };
124
+ if (type.type === "UUID") return { field_14: {} };
125
+ if (type.type === "FLOAT16") return { field_15: {} };
126
+ if (type.type === "VARIANT") return { field_16: {} };
127
+ if (type.type === "GEOMETRY") return { field_17: { field_1: type.crs } };
128
+ if (type.type === "GEOGRAPHY") return { field_18: {
129
+ field_1: type.crs,
130
+ field_2: type.algorithm && EdgeInterpolationAlgorithms.indexOf(type.algorithm)
131
+ } };
132
+ }
133
+ function timeUnit(unit) {
134
+ if (unit === "NANOS") return { field_3: {} };
135
+ if (unit === "MICROS") return { field_2: {} };
136
+ return { field_1: {} };
137
+ }
138
+ export { logicalType, writeMetadata };
@@ -0,0 +1,8 @@
1
+ import { ByteWriter } from "./bytewriter.mjs";
2
+ import "./schema.mjs";
3
+ import "./wkb.mjs";
4
+ import "./parquet-writer.mjs";
5
+ import "./write.mjs";
6
+ import { parquetWriteRows } from "./write-rows.mjs";
7
+ import "./index.mjs";
8
+ export { ByteWriter, parquetWriteRows };
@@ -0,0 +1,139 @@
1
+ import { getSchemaPath } from "../../../../hyparquet@1.26.1/node_modules/hyparquet/src/schema.mjs";
2
+ import { writeBlooms } from "./bloom.mjs";
3
+ import { encodeVariantColumn } from "./variant.mjs";
4
+ import { writeColumn } from "./column.mjs";
5
+ import { encodeNestedValues } from "./dremel.mjs";
6
+ import { writeIndexes } from "./indexes.mjs";
7
+ import { writeMetadata } from "./metadata.mjs";
8
+ import { snappyCompress } from "./snappy.mjs";
9
+ function ParquetWriter({ writer, schema, codec = "SNAPPY", compressors, statistics = true, kvMetadata }) {
10
+ this.writer = writer;
11
+ this.schema = schema;
12
+ this.codec = codec;
13
+ this.compressors = {
14
+ SNAPPY: snappyCompress,
15
+ ...compressors
16
+ };
17
+ this.statistics = statistics;
18
+ this.kvMetadata = kvMetadata;
19
+ this.row_groups = [];
20
+ this.num_rows = 0n;
21
+ this.pendingIndexes = [];
22
+ this.writer.appendUint32(827474256);
23
+ }
24
+ ParquetWriter.prototype.write = function({ columnData, rowGroupSize = [1e3, 1e5], pageSize = 1048576 }) {
25
+ const columnDataRows = columnData[0]?.data?.length || 0;
26
+ let pending;
27
+ for (const { groupStartIndex, groupSize } of groupIterator({
28
+ columnDataRows,
29
+ rowGroupSize
30
+ })) {
31
+ const writeGroup = () => {
32
+ const groupStartOffset = this.writer.offset;
33
+ const columns = [];
34
+ for (let j = 0; j < columnData.length; j++) {
35
+ const { name, data, encoding, codec = this.codec, columnIndex = false, offsetIndex = true, shredding, bloomFilter } = columnData[j];
36
+ if (columnIndex && !offsetIndex) throw new Error("parquet ColumnIndex cannot be present without OffsetIndex");
37
+ if (data.length !== columnDataRows) throw new Error("parquet columns must have the same length");
38
+ const groupData = data.slice(groupStartIndex, groupStartIndex + groupSize);
39
+ const columnPath = getSchemaPath(this.schema, [name]);
40
+ const leafPaths = getLeafSchemaPaths(columnPath);
41
+ const columnElement = columnPath.at(-1)?.element;
42
+ const shreddingConfig = shredding && shredding !== true ? shredding : void 0;
43
+ const isVariant = columnElement?.logical_type?.type === "VARIANT";
44
+ const isRequired = columnElement?.repetition_type === "REQUIRED";
45
+ const rows = isVariant ? encodeVariantColumn(Array.from(groupData), shreddingConfig, {
46
+ name,
47
+ required: isRequired
48
+ }) : groupData;
49
+ for (const leafPath of leafPaths) {
50
+ const schemaPath = leafPath.map((node) => node.element);
51
+ const column = {
52
+ columnName: schemaPath.slice(1).map((s) => s.name).join("."),
53
+ element: schemaPath[schemaPath.length - 1],
54
+ schemaPath,
55
+ codec,
56
+ compressors: this.compressors,
57
+ stats: this.statistics,
58
+ pageSize,
59
+ columnIndex,
60
+ offsetIndex,
61
+ encoding,
62
+ bloomFilter
63
+ };
64
+ const pageData = encodeNestedValues(leafPath, rows);
65
+ const result = writeColumn({
66
+ writer: this.writer,
67
+ column,
68
+ pageData
69
+ });
70
+ columns.push(result.chunk);
71
+ this.pendingIndexes.push(result);
72
+ }
73
+ }
74
+ this.num_rows += BigInt(groupSize);
75
+ this.row_groups.push({
76
+ columns,
77
+ total_byte_size: BigInt(this.writer.offset - groupStartOffset),
78
+ num_rows: BigInt(groupSize)
79
+ });
80
+ return this.writer.flush?.();
81
+ };
82
+ if (pending) pending = pending.then(writeGroup);
83
+ else {
84
+ const r = writeGroup();
85
+ if (r) pending = Promise.resolve(r);
86
+ }
87
+ }
88
+ return pending;
89
+ };
90
+ ParquetWriter.prototype.finish = function() {
91
+ writeIndexes(this.writer, this.pendingIndexes);
92
+ writeBlooms(this.writer, this.pendingIndexes);
93
+ const metadata = {
94
+ version: 2,
95
+ created_by: "hyparquet",
96
+ schema: this.schema,
97
+ num_rows: this.num_rows,
98
+ row_groups: this.row_groups,
99
+ metadata_length: 0,
100
+ key_value_metadata: this.kvMetadata
101
+ };
102
+ delete metadata.metadata_length;
103
+ writeMetadata(this.writer, metadata);
104
+ this.writer.appendUint32(827474256);
105
+ return this.writer.finish();
106
+ };
107
+ function groupSize(rowGroupSize, i) {
108
+ return Array.isArray(rowGroupSize) ? rowGroupSize[Math.min(i, rowGroupSize.length - 1)] : rowGroupSize;
109
+ }
110
+ function groupIterator({ columnDataRows, rowGroupSize }) {
111
+ if (Array.isArray(rowGroupSize) && !rowGroupSize.length) throw new Error("rowGroupSize array cannot be empty");
112
+ const groups = [];
113
+ let groupIndex = 0;
114
+ let groupStartIndex = 0;
115
+ while (groupStartIndex < columnDataRows) {
116
+ const size = groupSize(rowGroupSize, groupIndex);
117
+ groups.push({
118
+ groupStartIndex,
119
+ groupSize: Math.min(size, columnDataRows - groupStartIndex)
120
+ });
121
+ groupStartIndex += size;
122
+ groupIndex++;
123
+ }
124
+ return groups;
125
+ }
126
+ function getLeafSchemaPaths(schemaPath) {
127
+ const leaves = [];
128
+ dfs(schemaPath);
129
+ return leaves;
130
+ function dfs(path) {
131
+ const node = path[path.length - 1];
132
+ if (!node.children.length) {
133
+ leaves.push(path);
134
+ return;
135
+ }
136
+ for (const child of node.children) dfs([...path, child]);
137
+ }
138
+ }
139
+ export { ParquetWriter, groupSize };
@@ -0,0 +1,68 @@
1
+ function writePlain(writer, values, type, fixedLength) {
2
+ if (type === "BOOLEAN") writePlainBoolean(writer, values);
3
+ else if (type === "INT32") writePlainInt32(writer, values);
4
+ else if (type === "INT64") writePlainInt64(writer, values);
5
+ else if (type === "FLOAT") writePlainFloat(writer, values);
6
+ else if (type === "DOUBLE") writePlainDouble(writer, values);
7
+ else if (type === "BYTE_ARRAY") writePlainByteArray(writer, values);
8
+ else if (type === "FIXED_LEN_BYTE_ARRAY") {
9
+ if (!fixedLength) throw new Error("parquet FIXED_LEN_BYTE_ARRAY expected type_length");
10
+ writePlainByteArrayFixed(writer, values, fixedLength);
11
+ } else throw new Error(`parquet unsupported type: ${type}`);
12
+ }
13
+ function writePlainBoolean(writer, values) {
14
+ let currentByte = 0;
15
+ for (let i = 0; i < values.length; i++) {
16
+ const value = values[i];
17
+ if (typeof value !== "boolean") throw new Error("parquet expected boolean value, got " + value);
18
+ const bitOffset = i % 8;
19
+ if (value) currentByte |= 1 << bitOffset;
20
+ if (bitOffset === 7) {
21
+ writer.appendUint8(currentByte);
22
+ currentByte = 0;
23
+ }
24
+ }
25
+ if (values.length % 8) writer.appendUint8(currentByte);
26
+ }
27
+ function writePlainInt32(writer, values) {
28
+ for (const value of values) {
29
+ if (!Number.isSafeInteger(value)) throw new Error("parquet expected integer value, got " + value);
30
+ if (value < -2147483648 || value > 2147483647) throw new Error("parquet expected int32 value, got " + value);
31
+ writer.appendInt32(value);
32
+ }
33
+ }
34
+ function writePlainInt64(writer, values) {
35
+ for (const value of values) {
36
+ if (typeof value !== "bigint") throw new Error("parquet expected bigint value, got " + value);
37
+ writer.appendInt64(value);
38
+ }
39
+ }
40
+ function writePlainFloat(writer, values) {
41
+ for (const value of values) {
42
+ if (typeof value !== "number") throw new Error("parquet expected number value, got " + value);
43
+ writer.appendFloat32(value);
44
+ }
45
+ }
46
+ function writePlainDouble(writer, values) {
47
+ for (const value of values) {
48
+ if (typeof value !== "number") throw new Error("parquet expected number value, got " + value);
49
+ writer.appendFloat64(value);
50
+ }
51
+ }
52
+ function writePlainByteArray(writer, values) {
53
+ for (const value of values) {
54
+ let bytes = value;
55
+ if (typeof bytes === "string") bytes = new TextEncoder().encode(value);
56
+ if (!(bytes instanceof Uint8Array)) throw new Error("parquet expected Uint8Array value, got " + typeof bytes);
57
+ writer.appendUint32(bytes.length);
58
+ writer.appendBytes(bytes);
59
+ }
60
+ }
61
+ function writePlainByteArrayFixed(writer, values, fixedLength) {
62
+ for (const value of values) {
63
+ if (!(value instanceof Uint8Array)) throw new Error("parquet expected Uint8Array value, got " + typeof value);
64
+ if (value.length !== fixedLength) throw new Error(`parquet expected Uint8Array of length ${fixedLength}`);
65
+ writer.appendBytes(value);
66
+ }
67
+ }
68
+ export { writePlain };