@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
package/dist/errors.d.mts CHANGED
@@ -1,2 +1,115 @@
1
- import { EngineError, EngineErrorKind, engineErrorToException, engineErrors, isEngineError } from "./_chunks/errors.mjs";
1
+ type EngineErrorKind = 'analyzer-not-found' | 'analyzer-capability-missing' | 'invalid-sql-literal' | 'placeholder-arity-mismatch' | 'invalid-search-types' | 'attached-table-missing' | 'manifest-cas-exhausted' | 'invalid-snapshot-filename' | 'unsupported-snapshot-index-version' | 'invalid-schema-identifier' | 'invalid-year-month' | 'missing-attach-url' | 'manifest-cas-round-lost' | 'iceberg-table-op-failed' | 'sink-table-flush-failed' | 'rollup-build-failed' | 'lock-acquire-timeout';
2
+ type EngineError = {
3
+ kind: 'analyzer-not-found';
4
+ tool: string;
5
+ message: string;
6
+ } | {
7
+ kind: 'analyzer-capability-missing';
8
+ tool: string;
9
+ missing: readonly string[];
10
+ message: string;
11
+ } | {
12
+ kind: 'invalid-sql-literal';
13
+ message: string;
14
+ } | {
15
+ kind: 'placeholder-arity-mismatch';
16
+ message: string;
17
+ } | {
18
+ kind: 'invalid-search-types';
19
+ message: string;
20
+ cause?: unknown;
21
+ } | {
22
+ kind: 'attached-table-missing';
23
+ missing: readonly string[];
24
+ message: string;
25
+ } | {
26
+ kind: 'manifest-cas-exhausted';
27
+ message: string;
28
+ siteId: string;
29
+ table: string;
30
+ attempts: number;
31
+ } | {
32
+ kind: 'invalid-snapshot-filename';
33
+ message: string;
34
+ fileName: string;
35
+ } | {
36
+ kind: 'unsupported-snapshot-index-version';
37
+ message: string;
38
+ version: unknown;
39
+ } | {
40
+ kind: 'invalid-schema-identifier';
41
+ message: string;
42
+ schema: string;
43
+ } | {
44
+ kind: 'invalid-year-month';
45
+ message: string;
46
+ value: string;
47
+ } | {
48
+ kind: 'missing-attach-url';
49
+ message: string;
50
+ fileName: string;
51
+ } | {
52
+ kind: 'manifest-cas-round-lost';
53
+ message: string;
54
+ siteId: string;
55
+ table: string;
56
+ attempt: number;
57
+ } | {
58
+ kind: 'iceberg-table-op-failed';
59
+ message: string;
60
+ op: 'create' | 'drop';
61
+ table: string;
62
+ cause?: unknown;
63
+ } | {
64
+ kind: 'sink-table-flush-failed';
65
+ message: string;
66
+ table: string;
67
+ cause?: unknown;
68
+ } | {
69
+ kind: 'rollup-build-failed';
70
+ message: string;
71
+ id: string;
72
+ cause?: unknown;
73
+ } | {
74
+ kind: 'lock-acquire-timeout';
75
+ message: string;
76
+ scope: string;
77
+ timeoutMs: number;
78
+ };
79
+ declare const engineErrors: {
80
+ readonly analyzerNotFound: (tool: string) => EngineError;
81
+ readonly analyzerCapabilityMissing: (tool: string, missing: readonly string[]) => EngineError;
82
+ readonly nonFiniteNumberLiteral: (value: number) => EngineError;
83
+ readonly controlCharsInLiteral: () => EngineError;
84
+ readonly uninlinableLiteralType: (type: string) => EngineError;
85
+ readonly morePlaceholdersThanParams: (have: number) => EngineError;
86
+ readonly dollarPlaceholderOutOfRange: (n: number, have: number) => EngineError;
87
+ readonly mixedPlaceholderStyles: () => EngineError;
88
+ readonly unusedParams: (unused: number) => EngineError;
89
+ readonly searchTypesNotArray: () => EngineError;
90
+ readonly unknownSearchType: (value: unknown) => EngineError;
91
+ readonly searchTypesMissingWeb: () => EngineError;
92
+ readonly attachedTableMissing: (missing: readonly string[]) => EngineError;
93
+ readonly manifestCasExhausted: (siteId: string, table: string, attempts: number) => EngineError;
94
+ readonly invalidSnapshotFilename: (fileName: string) => EngineError;
95
+ readonly unsupportedSnapshotIndexVersion: (version: unknown) => EngineError;
96
+ readonly invalidSchemaIdentifier: (schema: string) => EngineError;
97
+ readonly invalidYearMonth: (value: string) => EngineError;
98
+ readonly missingAttachUrl: (fileName: string) => EngineError;
99
+ readonly manifestCasRoundLost: (siteId: string, table: string, attempt: number) => EngineError;
100
+ readonly icebergTableOpFailed: (op: 'create' | 'drop', table: string, cause: unknown) => EngineError;
101
+ readonly sinkTableFlushFailed: (table: string, cause: unknown) => EngineError;
102
+ readonly rollupBuildFailed: (id: string, cause: unknown) => EngineError;
103
+ readonly lockAcquireTimeout: (scope: string, timeoutMs: number) => EngineError;
104
+ };
105
+ declare function isEngineError(value: unknown): value is EngineError;
106
+ /**
107
+ * Re-raises an `EngineError` value as a generic `Error`, stashing the union under
108
+ * `.engineError` for stack-walking. Used by the throwing wrappers over the
109
+ * `Result`-returning cores whose original throws were bare `Error`s (the SQL
110
+ * binder, sync-config). Modules that historically threw a *named* class
111
+ * (`AnalyzerCapabilityError`, `AttachedTableMissingError`) provide their own
112
+ * mapper so the class identity callers match on is preserved.
113
+ */
114
+ declare function engineErrorToException(error: EngineError): Error;
2
115
  export { EngineError, EngineErrorKind, engineErrorToException, engineErrors, isEngineError };
package/dist/gc.mjs ADDED
@@ -0,0 +1,92 @@
1
+ import { tenantPrefix } from "./layout.mjs";
2
+ const DEFAULT_HOURLY_RETENTION_MS = 2160 * 60 * 60 * 1e3;
3
+ const VERSION_RE = /__v(\d+)\.parquet$/;
4
+ function parseLockScope(key) {
5
+ const match = VERSION_RE.exec(key);
6
+ if (!match) return void 0;
7
+ const parts = key.slice(0, match.index).split("/");
8
+ if (parts.length < 4) return void 0;
9
+ const userPart = parts[0];
10
+ if (!userPart.startsWith("u_")) return void 0;
11
+ const userId = userPart.slice(2);
12
+ const partition = parts.slice(-2).join("/");
13
+ const table = parts[parts.length - 3];
14
+ return {
15
+ userId,
16
+ siteId: parts.length >= 5 ? parts.slice(1, -3).join("/") : void 0,
17
+ table,
18
+ partition
19
+ };
20
+ }
21
+ async function gcOrphansImpl(deps, now, graceMs, opts = {}) {
22
+ const cutoff = now - graceMs;
23
+ const retired = await deps.manifestStore.listRetired(cutoff);
24
+ if (retired.length > 0) {
25
+ await deps.dataSource.delete(retired.map((e) => e.objectKey));
26
+ await deps.manifestStore.delete(retired);
27
+ }
28
+ let hourlyDeleted = 0;
29
+ if (opts.userId) {
30
+ const hourlyCutoff = now - (opts.hourlyRetentionMs ?? DEFAULT_HOURLY_RETENTION_MS);
31
+ const expiredHourly = (await deps.manifestStore.listAll({
32
+ userId: opts.userId,
33
+ siteId: opts.siteId
34
+ })).filter((e) => e.partition.startsWith("hourly/") && e.createdAt < hourlyCutoff);
35
+ if (expiredHourly.length > 0) {
36
+ await deps.dataSource.delete(expiredHourly.map((e) => e.objectKey));
37
+ await deps.manifestStore.delete(expiredHourly);
38
+ hourlyDeleted = expiredHourly.length;
39
+ }
40
+ }
41
+ let sweptOrphans = 0;
42
+ if (opts.userId) {
43
+ const prefix = tenantPrefix({
44
+ userId: opts.userId,
45
+ siteId: opts.siteId
46
+ });
47
+ const knownEntries = await deps.manifestStore.listAll({
48
+ userId: opts.userId,
49
+ siteId: opts.siteId
50
+ });
51
+ const knownSet = new Set(knownEntries.map((e) => e.objectKey));
52
+ const orphans = [];
53
+ const keyStream = deps.dataSource.streamList ? deps.dataSource.streamList(prefix) : async function* () {
54
+ const all = await deps.dataSource.list(prefix);
55
+ for (const k of all) yield k;
56
+ }();
57
+ for await (const key of keyStream) {
58
+ if (knownSet.has(key)) continue;
59
+ const match = VERSION_RE.exec(key);
60
+ if (!match) continue;
61
+ if (Number(match[1]) <= cutoff) orphans.push(key);
62
+ }
63
+ const byScope = /* @__PURE__ */ new Map();
64
+ for (const key of orphans) {
65
+ const scope = parseLockScope(key);
66
+ if (!scope) continue;
67
+ const sk = `${scope.userId}|${scope.siteId ?? ""}|${scope.table}|${scope.partition}`;
68
+ const bucket = byScope.get(sk) ?? {
69
+ scope,
70
+ keys: []
71
+ };
72
+ bucket.keys.push(key);
73
+ byScope.set(sk, bucket);
74
+ }
75
+ for (const { scope, keys } of byScope.values()) await deps.manifestStore.withLock(scope, async () => {
76
+ const known = await deps.manifestStore.listAll({
77
+ userId: scope.userId,
78
+ siteId: scope.siteId,
79
+ table: scope.table,
80
+ partitions: [scope.partition]
81
+ });
82
+ const knownInScope = new Set(known.map((e) => e.objectKey));
83
+ const stillOrphans = keys.filter((k) => !knownInScope.has(k));
84
+ if (stillOrphans.length > 0) {
85
+ await deps.dataSource.delete(stillOrphans);
86
+ sweptOrphans += stillOrphans.length;
87
+ }
88
+ });
89
+ }
90
+ return { deleted: retired.length + sweptOrphans + hourlyDeleted };
91
+ }
92
+ export { gcOrphansImpl };
@@ -0,0 +1,14 @@
1
+ import { IcebergAppendSinkOptions, Sink } from "../sink.mjs";
2
+ type IcebergAppendSink = Sink;
3
+ /**
4
+ * Create an `IcebergAppendSink` over the R2 Data Catalog.
5
+ *
6
+ * `emit` buffers; `close()` commits one `icebergAppend()` per table touched.
7
+ * The catalog connection (REST context + signed S3 resolver) is established
8
+ * lazily on the first flush and reused — a sink that is opened and closed
9
+ * with no rows never touches the network. `options.connect` is forwarded so
10
+ * Worker callers can share the `/v1/config` context through a durable cache;
11
+ * without it every fresh sink/isolate must probe the catalog again.
12
+ */
13
+ declare function createIcebergAppendSink(options: IcebergAppendSinkOptions): IcebergAppendSink;
14
+ export { IcebergAppendSink, createIcebergAppendSink };
@@ -0,0 +1,142 @@
1
+ import { engineErrors } from "../errors.mjs";
2
+ import { DEFAULT_PARTITION_KEY_ENCODING, gscDataset } from "./schema.mjs";
3
+ import { connectIcebergCatalog, icebergAppendRetrying } from "./catalog.mjs";
4
+ const DAY_MILLIS = 864e5;
5
+ const INT32_MIN = -2147483648;
6
+ const INT32_MAX = 2147483647;
7
+ function toIcebergDate(value) {
8
+ if (typeof value === "string") {
9
+ const ms = Date.parse(`${value}T00:00:00Z`);
10
+ if (Number.isNaN(ms)) throw new TypeError(`toIcebergDate: invalid date string '${value}'`);
11
+ return Math.floor(ms / DAY_MILLIS);
12
+ }
13
+ if (value instanceof Date) {
14
+ const ms = value.getTime();
15
+ if (Number.isNaN(ms)) throw new TypeError("toIcebergDate: invalid Date (NaN)");
16
+ return Math.floor(ms / DAY_MILLIS);
17
+ }
18
+ return value;
19
+ }
20
+ function coerceJsonSafe(value) {
21
+ if (typeof value === "bigint") return Number(value);
22
+ return value;
23
+ }
24
+ function toIntPartitionSiteId(value) {
25
+ if (value == null || typeof value === "string" && value.trim() === "") throw new TypeError("toRecords: slice.ctx.siteId is required for int partition encoding");
26
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "bigint") throw new TypeError(`toRecords: int partition site_id must be a safe integer, got '${String(value)}'`);
27
+ const siteId = Number(value);
28
+ if (!Number.isSafeInteger(siteId)) throw new TypeError(`toRecords: int partition site_id must be a safe integer, got '${String(value)}'`);
29
+ if (siteId < INT32_MIN || siteId > INT32_MAX) throw new TypeError(`toRecords: int partition site_id must fit Iceberg INT, got '${String(value)}'`);
30
+ return siteId;
31
+ }
32
+ function dedupeByIdentity(table, records) {
33
+ if (records.length < 2) return records;
34
+ const key = gscDataset(table, "int").tableSpec.identityColumns;
35
+ const seen = /* @__PURE__ */ new Map();
36
+ for (const rec of records) {
37
+ let identity = "";
38
+ for (let index = 0; index < key.length; index++) {
39
+ if (index > 0) identity += "\0";
40
+ identity += `${rec[key[index]] ?? ""}`;
41
+ }
42
+ seen.set(identity, rec);
43
+ }
44
+ return seen.size === records.length ? records : [...seen.values()];
45
+ }
46
+ function sortByClusterKey(table, records) {
47
+ const cols = gscDataset(table, "int").tableSpec.clusterKey ?? [];
48
+ if (cols.length === 0 || records.length < 2) return records;
49
+ return records.slice().sort((a, b) => {
50
+ for (const col of cols) {
51
+ const av = a[col];
52
+ const bv = b[col];
53
+ if (av === bv) continue;
54
+ if (av == null) return -1;
55
+ if (bv == null) return 1;
56
+ if (typeof av === "number" && typeof bv === "number") return av - bv;
57
+ const as = String(av);
58
+ const bs = String(bv);
59
+ if (as !== bs) return as < bs ? -1 : 1;
60
+ }
61
+ return 0;
62
+ });
63
+ }
64
+ function toRecords(slice, rows, encoding) {
65
+ const siteVal = encoding === "int" ? toIntPartitionSiteId(slice.ctx.siteId) : slice.ctx.siteId ?? "";
66
+ const searchVal = gscDataset(slice.table, encoding).def.dims.search_type.toPartitionValue(slice.searchType);
67
+ return rows.map((row) => {
68
+ const out = {};
69
+ for (const k in row) out[k] = coerceJsonSafe(row[k]);
70
+ out.date = toIcebergDate(out.date);
71
+ out.site_id = siteVal;
72
+ out.search_type = searchVal;
73
+ return out;
74
+ });
75
+ }
76
+ function createIcebergAppendSink(options) {
77
+ let connection;
78
+ const encoding = options.encoding ?? DEFAULT_PARTITION_KEY_ENCODING;
79
+ const buffers = /* @__PURE__ */ new Map();
80
+ function connect() {
81
+ connection ??= connectIcebergCatalog(options.catalog, options.connect);
82
+ return connection;
83
+ }
84
+ return {
85
+ capabilities: { appendOnly: true },
86
+ async emit(slice, rows) {
87
+ if (rows.length === 0) return { rowCount: 0 };
88
+ const records = toRecords(slice, rows, encoding);
89
+ const buffer = buffers.get(slice.table);
90
+ if (buffer) for (let i = 0; i < records.length; i++) buffer.push(records[i]);
91
+ else buffers.set(slice.table, records);
92
+ return { rowCount: records.length };
93
+ },
94
+ async close() {
95
+ const flushed = [];
96
+ const failed = [];
97
+ if (buffers.size === 0) return {
98
+ flushed,
99
+ failed
100
+ };
101
+ const conn = await connect().then((c) => c, (cause) => {
102
+ connection = void 0;
103
+ return { connectError: cause };
104
+ });
105
+ if ("connectError" in conn) {
106
+ for (const [table, records] of buffers) if (records.length > 0) failed.push({
107
+ table,
108
+ error: engineErrors.sinkTableFlushFailed(table, conn.connectError)
109
+ });
110
+ buffers.clear();
111
+ return {
112
+ flushed,
113
+ failed
114
+ };
115
+ }
116
+ for (const [table, records] of buffers) {
117
+ if (records.length === 0) continue;
118
+ const deduped = sortByClusterKey(table, dedupeByIdentity(table, records));
119
+ await icebergAppendRetrying({
120
+ catalog: conn.catalog,
121
+ namespace: conn.namespace,
122
+ table,
123
+ resolver: conn.resolver,
124
+ records: deduped
125
+ }, options.commitRetry).then(() => {
126
+ flushed.push(table);
127
+ }, (cause) => {
128
+ failed.push({
129
+ table,
130
+ error: engineErrors.sinkTableFlushFailed(table, cause)
131
+ });
132
+ });
133
+ }
134
+ buffers.clear();
135
+ return {
136
+ flushed,
137
+ failed
138
+ };
139
+ }
140
+ };
141
+ }
142
+ export { createIcebergAppendSink };
@@ -0,0 +1,71 @@
1
+ import { EngineError } from "../errors.mjs";
2
+ import { IcebergTableName, PartitionKeyEncoding } from "./schema.mjs";
3
+ import { icebergCreateTable } from "../node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/write/write.mjs";
4
+ import "../node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/index.mjs";
5
+ import { Result } from "gscdump/result";
6
+ import { CommitRetryOptions, ConnectIcebergOptions, IcebergCatalogConfig, IcebergConnection, IcebergListedDataFile, QueryProfiler } from "@gscdump/lakehouse";
7
+ type IcebirdCreateTableOptions = Parameters<typeof icebergCreateTable>[0];
8
+ type IcebirdSchema = NonNullable<IcebirdCreateTableOptions['schema']>;
9
+ type IcebirdPartitionSpec = NonNullable<IcebirdCreateTableOptions['partitionSpec']>;
10
+ type IcebirdSortOrder = NonNullable<IcebirdCreateTableOptions['sortOrder']>;
11
+ /**
12
+ * Build the icebird `Schema` for one of the 9 fact tables from the frozen
13
+ * `ICEBERG_SCHEMAS` contract. Field ids are advisory — R2 Data Catalog
14
+ * re-assigns them on `createTable`.
15
+ */
16
+ declare function icebergSchemaFor(table: IcebergTableName, encoding?: PartitionKeyEncoding): IcebirdSchema;
17
+ /**
18
+ * Build the icebird `PartitionSpec` for one of the 9 fact tables: the locked
19
+ * spec `identity(site_id) + identity(search_type) + month(date)`.
20
+ */
21
+ declare function icebergPartitionSpecFor(table: IcebergTableName, encoding?: PartitionKeyEncoding): IcebirdPartitionSpec;
22
+ /**
23
+ * Build the icebird `SortOrder` for a fact table from its `clusterKey`
24
+ * (dimension-first, then `date`).
25
+ */
26
+ declare function icebergSortOrderFor(table: IcebergTableName, encoding?: PartitionKeyEncoding): IcebirdSortOrder;
27
+ /**
28
+ * Outcome of a single table create/drop: the table name plus a `Result` —
29
+ * `Ok(void)` on success, `Err(iceberg-table-op-failed)` carrying the failure
30
+ * message when the catalog rejects the op. Per-table so a partial
31
+ * provisioning run is fully observable.
32
+ */
33
+ interface IcebergTableOpResult {
34
+ table: string;
35
+ outcome: Result<void, EngineError>;
36
+ }
37
+ /**
38
+ * Create the global Iceberg fact tables with the locked partition spec and
39
+ * the schema derived from {@link ICEBERG_SCHEMAS}. Per-table errors are
40
+ * captured rather than thrown so a partial run is observable.
41
+ */
42
+ declare function createIcebergTables(conn: IcebergConnection, tables?: readonly IcebergTableName[], encoding?: PartitionKeyEncoding): Promise<IcebergTableOpResult[]>;
43
+ /**
44
+ * Drop tables from the catalog namespace, purging their data objects.
45
+ * Defaults to every table currently in the namespace. Delegates the walk to
46
+ * `@gscdump/lakehouse`'s generic `dropIcebergTables`, mapping its simpler
47
+ * `{table, ok, error?}` result back onto the engine's original `Result`-typed
48
+ * {@link IcebergTableOpResult} contract.
49
+ */
50
+ declare function dropIcebergTables$1(conn: IcebergConnection, tables?: readonly string[]): Promise<IcebergTableOpResult[]>;
51
+ interface ListIcebergDataFilesOptions {
52
+ table: IcebergTableName;
53
+ /** Partition identity column. `number` for `'int'`-encoded catalogs. */
54
+ siteId: string | number;
55
+ /** Partition identity column. `number` (int code) for `'int'`-encoded catalogs. */
56
+ searchType: string | number;
57
+ encoding?: PartitionKeyEncoding;
58
+ range: {
59
+ start: string;
60
+ end: string;
61
+ };
62
+ cache?: import('@gscdump/lakehouse').CatalogCache;
63
+ clock?: () => number;
64
+ profiler?: QueryProfiler;
65
+ }
66
+ /**
67
+ * List the parquet data files in the current snapshot of `table`, filtered to
68
+ * a single partition slice `(siteId, searchType, month(date) ∈ range)`.
69
+ */
70
+ declare function listIcebergDataFiles(conn: IcebergConnection, opts: ListIcebergDataFilesOptions): Promise<IcebergListedDataFile[]>;
71
+ export { type CommitRetryOptions, type ConnectIcebergOptions, type IcebergCatalogConfig, IcebergTableOpResult, ListIcebergDataFilesOptions, createIcebergTables, dropIcebergTables$1 as dropIcebergTables, icebergPartitionSpecFor, icebergSchemaFor, icebergSortOrderFor, listIcebergDataFiles };
@@ -0,0 +1,109 @@
1
+ import { engineErrors } from "../errors.mjs";
2
+ import { TABLE_METADATA } from "../drizzle-schema.mjs";
3
+ import "../schema.mjs";
4
+ import { DEFAULT_PARTITION_KEY_ENCODING, ICEBERG_PARTITION_SPEC, ICEBERG_TABLES, icebergSchemasFor } from "./schema.mjs";
5
+ import { icebergCreateTable } from "../node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/write.mjs";
6
+ import "../node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/index.mjs";
7
+ import { err, ok } from "gscdump/result";
8
+ import { ICEBERG_TYPE_MAP, connectIcebergCatalog, dropIcebergTables, resolveIcebergDataFiles } from "@gscdump/lakehouse";
9
+ import { icebergAppendRetrying } from "@gscdump/lakehouse/unsafe-raw";
10
+ function icebergSchemaFor(table, encoding = DEFAULT_PARTITION_KEY_ENCODING) {
11
+ return {
12
+ "type": "struct",
13
+ "schema-id": 0,
14
+ "fields": icebergSchemasFor(encoding)[table].columns.map((col) => ({
15
+ id: col.fieldId,
16
+ name: col.name,
17
+ required: col.required,
18
+ type: ICEBERG_TYPE_MAP[col.type]
19
+ }))
20
+ };
21
+ }
22
+ function icebergPartitionSpecFor(table, encoding = DEFAULT_PARTITION_KEY_ENCODING) {
23
+ const fields = icebergSchemasFor(encoding)[table].columns;
24
+ const fieldId = (name) => {
25
+ const col = fields.find((c) => c.name === name);
26
+ if (!col) throw new Error(`iceberg-catalog: table '${table}' has no '${name}' column`);
27
+ return col.fieldId;
28
+ };
29
+ return {
30
+ "spec-id": 0,
31
+ "fields": ICEBERG_PARTITION_SPEC.map((p, i) => ({
32
+ "source-id": fieldId(p.sourceColumn),
33
+ "field-id": 1e3 + i,
34
+ "name": p.name,
35
+ "transform": p.transform
36
+ }))
37
+ };
38
+ }
39
+ function icebergSortOrderFor(table, encoding = DEFAULT_PARTITION_KEY_ENCODING) {
40
+ const fields = icebergSchemasFor(encoding)[table].columns;
41
+ const fieldId = (name) => {
42
+ const col = fields.find((c) => c.name === name);
43
+ if (!col) throw new Error(`iceberg-catalog: table '${table}' has no '${name}' column`);
44
+ return col.fieldId;
45
+ };
46
+ return {
47
+ "order-id": 1,
48
+ "fields": TABLE_METADATA[table].clusterKey.map((col) => ({
49
+ "source-id": fieldId(col),
50
+ "transform": "identity",
51
+ "direction": "asc",
52
+ "null-order": "nulls-last"
53
+ }))
54
+ };
55
+ }
56
+ async function createIcebergTables(conn, tables = ICEBERG_TABLES, encoding = DEFAULT_PARTITION_KEY_ENCODING) {
57
+ const results = [];
58
+ for (const table of tables) await icebergCreateTable({
59
+ catalog: conn.catalog,
60
+ namespace: conn.namespace,
61
+ table,
62
+ schema: icebergSchemaFor(table, encoding),
63
+ partitionSpec: icebergPartitionSpecFor(table, encoding),
64
+ sortOrder: icebergSortOrderFor(table, encoding)
65
+ }).then(() => results.push({
66
+ table,
67
+ outcome: ok(void 0)
68
+ }), (e) => results.push({
69
+ table,
70
+ outcome: err(engineErrors.icebergTableOpFailed("create", table, e))
71
+ }));
72
+ return results;
73
+ }
74
+ async function dropIcebergTables$1(conn, tables) {
75
+ return (await dropIcebergTables(conn, tables)).map((r) => ({
76
+ table: r.table,
77
+ outcome: r.ok ? ok(void 0) : err(engineErrors.icebergTableOpFailed("drop", r.table, r.error))
78
+ }));
79
+ }
80
+ async function listIcebergDataFiles(conn, opts) {
81
+ const matches = (opts.encoding ?? DEFAULT_PARTITION_KEY_ENCODING) === "string" ? [{
82
+ field: "site_id",
83
+ value: opts.siteId,
84
+ encoding: "string"
85
+ }, {
86
+ field: "search_type",
87
+ value: opts.searchType,
88
+ encoding: "string"
89
+ }] : [{
90
+ field: "site_id",
91
+ value: opts.siteId,
92
+ encoding: "int32"
93
+ }, {
94
+ field: "search_type",
95
+ value: opts.searchType,
96
+ encoding: "int32"
97
+ }];
98
+ return resolveIcebergDataFiles(conn, {
99
+ namespace: conn.namespace,
100
+ table: opts.table,
101
+ partitionSpec: ICEBERG_PARTITION_SPEC,
102
+ matches,
103
+ range: opts.range,
104
+ cache: opts.cache,
105
+ clock: opts.clock,
106
+ profiler: opts.profiler
107
+ });
108
+ }
109
+ export { connectIcebergCatalog, createIcebergTables, dropIcebergTables$1 as dropIcebergTables, icebergAppendRetrying, icebergPartitionSpecFor, icebergSchemaFor, icebergSortOrderFor, listIcebergDataFiles };
@@ -1,14 +1,5 @@
1
- import { ICEBERG_FIELD_ID_BASE, ICEBERG_PARTITION_COLUMNS, ICEBERG_PARTITION_SPEC, ICEBERG_SCHEMAS, ICEBERG_SCHEMAS_INT, ICEBERG_SCHEMAS_STRING, ICEBERG_TABLES, INT_SEARCH_TYPE, IcebergAppendSinkOptions, IcebergTableName, IcebergTableOpResult, ListIcebergDataFilesOptions, SEARCH_TYPE_INT, Sink, assertIcebergTable, createIcebergTables, dropIcebergTables, icebergPartitionColumns, icebergPartitionSpecFor, icebergSchemaFor, icebergSchemasFor, icebergSortOrderFor, icebergTableSpec, isIcebergTable, listIcebergDataFiles } from "../_chunks/sink.mjs";
2
- type IcebergAppendSink = Sink;
3
- /**
4
- * Create an `IcebergAppendSink` over the R2 Data Catalog.
5
- *
6
- * `emit` buffers; `close()` commits one `icebergAppend()` per table touched.
7
- * The catalog connection (REST context + signed S3 resolver) is established
8
- * lazily on the first flush and reused — a sink that is opened and closed
9
- * with no rows never touches the network. `options.connect` is forwarded so
10
- * Worker callers can share the `/v1/config` context through a durable cache;
11
- * without it every fresh sink/isolate must probe the catalog again.
12
- */
13
- declare function createIcebergAppendSink(options: IcebergAppendSinkOptions): IcebergAppendSink;
1
+ import { ICEBERG_FIELD_ID_BASE, ICEBERG_PARTITION_COLUMNS, ICEBERG_PARTITION_SPEC, ICEBERG_SCHEMAS, ICEBERG_SCHEMAS_INT, ICEBERG_SCHEMAS_STRING, ICEBERG_TABLES, INT_SEARCH_TYPE, IcebergTableName, SEARCH_TYPE_INT, assertIcebergTable, icebergPartitionColumns, icebergSchemasFor, icebergTableSpec, isIcebergTable } from "./schema.mjs";
2
+ import { IcebergTableOpResult, ListIcebergDataFilesOptions, createIcebergTables, dropIcebergTables, icebergPartitionSpecFor, icebergSchemaFor, icebergSortOrderFor, listIcebergDataFiles } from "./catalog.mjs";
3
+ import { IcebergAppendSinkOptions } from "../sink.mjs";
4
+ import { IcebergAppendSink, createIcebergAppendSink } from "./append-sink.mjs";
14
5
  export { ICEBERG_FIELD_ID_BASE, ICEBERG_PARTITION_COLUMNS, ICEBERG_PARTITION_SPEC, ICEBERG_SCHEMAS, ICEBERG_SCHEMAS_INT, ICEBERG_SCHEMAS_STRING, ICEBERG_TABLES, INT_SEARCH_TYPE, type IcebergAppendSink, type IcebergAppendSinkOptions, type IcebergTableName, type IcebergTableOpResult, type ListIcebergDataFilesOptions, SEARCH_TYPE_INT, assertIcebergTable, createIcebergAppendSink, createIcebergTables, dropIcebergTables, icebergPartitionColumns, icebergPartitionSpecFor, icebergSchemaFor, icebergSchemasFor, icebergSortOrderFor, icebergTableSpec, isIcebergTable, listIcebergDataFiles };