@gscdump/engine 1.4.0 → 1.4.1

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} +2 -34
  34. package/dist/{_chunks/schema.mjs → drizzle-schema.mjs} +2 -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 +110 -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 +4 -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
@@ -1,245 +1,4 @@
1
- import { engineErrors } from "../errors.mjs";
2
- import { TABLE_METADATA } from "../_chunks/schema.mjs";
3
- import { DEFAULT_PARTITION_KEY_ENCODING, ICEBERG_FIELD_ID_BASE, ICEBERG_PARTITION_COLUMNS, ICEBERG_PARTITION_SPEC, ICEBERG_SCHEMAS, ICEBERG_SCHEMAS_INT, ICEBERG_SCHEMAS_STRING, ICEBERG_TABLES, INT_SEARCH_TYPE, SEARCH_TYPE_INT, assertIcebergTable, gscDataset, icebergPartitionColumns, icebergSchemasFor, icebergTableSpec, isIcebergTable } from "../_chunks/schema2.mjs";
4
- import { icebergCreateTable } from "../_chunks/libs/icebird.mjs";
5
- import { err, ok } from "gscdump/result";
6
- import { ICEBERG_TYPE_MAP, connectIcebergCatalog, dropIcebergTables as dropIcebergTables$1, resolveIcebergDataFiles } from "@gscdump/lakehouse";
7
- import { icebergAppendRetrying } from "@gscdump/lakehouse/unsafe-raw";
8
- function icebergSchemaFor(table, encoding = DEFAULT_PARTITION_KEY_ENCODING) {
9
- return {
10
- "type": "struct",
11
- "schema-id": 0,
12
- "fields": icebergSchemasFor(encoding)[table].columns.map((col) => ({
13
- id: col.fieldId,
14
- name: col.name,
15
- required: col.required,
16
- type: ICEBERG_TYPE_MAP[col.type]
17
- }))
18
- };
19
- }
20
- function icebergPartitionSpecFor(table, encoding = DEFAULT_PARTITION_KEY_ENCODING) {
21
- const fields = icebergSchemasFor(encoding)[table].columns;
22
- const fieldId = (name) => {
23
- const col = fields.find((c) => c.name === name);
24
- if (!col) throw new Error(`iceberg-catalog: table '${table}' has no '${name}' column`);
25
- return col.fieldId;
26
- };
27
- return {
28
- "spec-id": 0,
29
- "fields": ICEBERG_PARTITION_SPEC.map((p, i) => ({
30
- "source-id": fieldId(p.sourceColumn),
31
- "field-id": 1e3 + i,
32
- "name": p.name,
33
- "transform": p.transform
34
- }))
35
- };
36
- }
37
- function icebergSortOrderFor(table, encoding = DEFAULT_PARTITION_KEY_ENCODING) {
38
- const fields = icebergSchemasFor(encoding)[table].columns;
39
- const fieldId = (name) => {
40
- const col = fields.find((c) => c.name === name);
41
- if (!col) throw new Error(`iceberg-catalog: table '${table}' has no '${name}' column`);
42
- return col.fieldId;
43
- };
44
- return {
45
- "order-id": 1,
46
- "fields": TABLE_METADATA[table].clusterKey.map((col) => ({
47
- "source-id": fieldId(col),
48
- "transform": "identity",
49
- "direction": "asc",
50
- "null-order": "nulls-last"
51
- }))
52
- };
53
- }
54
- async function createIcebergTables(conn, tables = ICEBERG_TABLES, encoding = DEFAULT_PARTITION_KEY_ENCODING) {
55
- const results = [];
56
- for (const table of tables) await icebergCreateTable({
57
- catalog: conn.catalog,
58
- namespace: conn.namespace,
59
- table,
60
- schema: icebergSchemaFor(table, encoding),
61
- partitionSpec: icebergPartitionSpecFor(table, encoding),
62
- sortOrder: icebergSortOrderFor(table, encoding)
63
- }).then(() => results.push({
64
- table,
65
- outcome: ok(void 0)
66
- }), (e) => results.push({
67
- table,
68
- outcome: err(engineErrors.icebergTableOpFailed("create", table, e))
69
- }));
70
- return results;
71
- }
72
- async function dropIcebergTables(conn, tables) {
73
- return (await dropIcebergTables$1(conn, tables)).map((r) => ({
74
- table: r.table,
75
- outcome: r.ok ? ok(void 0) : err(engineErrors.icebergTableOpFailed("drop", r.table, r.error))
76
- }));
77
- }
78
- async function listIcebergDataFiles(conn, opts) {
79
- const matches = (opts.encoding ?? DEFAULT_PARTITION_KEY_ENCODING) === "string" ? [{
80
- field: "site_id",
81
- value: opts.siteId,
82
- encoding: "string"
83
- }, {
84
- field: "search_type",
85
- value: opts.searchType,
86
- encoding: "string"
87
- }] : [{
88
- field: "site_id",
89
- value: opts.siteId,
90
- encoding: "int32"
91
- }, {
92
- field: "search_type",
93
- value: opts.searchType,
94
- encoding: "int32"
95
- }];
96
- return resolveIcebergDataFiles(conn, {
97
- namespace: conn.namespace,
98
- table: opts.table,
99
- partitionSpec: ICEBERG_PARTITION_SPEC,
100
- matches,
101
- range: opts.range,
102
- cache: opts.cache,
103
- clock: opts.clock,
104
- profiler: opts.profiler
105
- });
106
- }
107
- const DAY_MILLIS = 864e5;
108
- const INT32_MIN = -2147483648;
109
- const INT32_MAX = 2147483647;
110
- function toIcebergDate(value) {
111
- if (typeof value === "string") {
112
- const ms = Date.parse(`${value}T00:00:00Z`);
113
- if (Number.isNaN(ms)) throw new TypeError(`toIcebergDate: invalid date string '${value}'`);
114
- return Math.floor(ms / DAY_MILLIS);
115
- }
116
- if (value instanceof Date) {
117
- const ms = value.getTime();
118
- if (Number.isNaN(ms)) throw new TypeError("toIcebergDate: invalid Date (NaN)");
119
- return Math.floor(ms / DAY_MILLIS);
120
- }
121
- return value;
122
- }
123
- function coerceJsonSafe(value) {
124
- if (typeof value === "bigint") return Number(value);
125
- return value;
126
- }
127
- function toIntPartitionSiteId(value) {
128
- if (value == null || typeof value === "string" && value.trim() === "") throw new TypeError("toRecords: slice.ctx.siteId is required for int partition encoding");
129
- 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)}'`);
130
- const siteId = Number(value);
131
- if (!Number.isSafeInteger(siteId)) throw new TypeError(`toRecords: int partition site_id must be a safe integer, got '${String(value)}'`);
132
- if (siteId < INT32_MIN || siteId > INT32_MAX) throw new TypeError(`toRecords: int partition site_id must fit Iceberg INT, got '${String(value)}'`);
133
- return siteId;
134
- }
135
- function dedupeByIdentity(table, records) {
136
- if (records.length < 2) return records;
137
- const key = gscDataset(table, "int").tableSpec.identityColumns;
138
- const seen = /* @__PURE__ */ new Map();
139
- for (const rec of records) {
140
- let identity = "";
141
- for (let index = 0; index < key.length; index++) {
142
- if (index > 0) identity += "\0";
143
- identity += `${rec[key[index]] ?? ""}`;
144
- }
145
- seen.set(identity, rec);
146
- }
147
- return seen.size === records.length ? records : [...seen.values()];
148
- }
149
- function sortByClusterKey(table, records) {
150
- const cols = gscDataset(table, "int").tableSpec.clusterKey ?? [];
151
- if (cols.length === 0 || records.length < 2) return records;
152
- return records.slice().sort((a, b) => {
153
- for (const col of cols) {
154
- const av = a[col];
155
- const bv = b[col];
156
- if (av === bv) continue;
157
- if (av == null) return -1;
158
- if (bv == null) return 1;
159
- if (typeof av === "number" && typeof bv === "number") return av - bv;
160
- const as = String(av);
161
- const bs = String(bv);
162
- if (as !== bs) return as < bs ? -1 : 1;
163
- }
164
- return 0;
165
- });
166
- }
167
- function toRecords(slice, rows, encoding) {
168
- const siteVal = encoding === "int" ? toIntPartitionSiteId(slice.ctx.siteId) : slice.ctx.siteId ?? "";
169
- const searchVal = gscDataset(slice.table, encoding).def.dims.search_type.toPartitionValue(slice.searchType);
170
- return rows.map((row) => {
171
- const out = {};
172
- for (const k in row) out[k] = coerceJsonSafe(row[k]);
173
- out.date = toIcebergDate(out.date);
174
- out.site_id = siteVal;
175
- out.search_type = searchVal;
176
- return out;
177
- });
178
- }
179
- function createIcebergAppendSink(options) {
180
- let connection;
181
- const encoding = options.encoding ?? DEFAULT_PARTITION_KEY_ENCODING;
182
- const buffers = /* @__PURE__ */ new Map();
183
- function connect() {
184
- connection ??= connectIcebergCatalog(options.catalog, options.connect);
185
- return connection;
186
- }
187
- return {
188
- capabilities: { appendOnly: true },
189
- async emit(slice, rows) {
190
- if (rows.length === 0) return { rowCount: 0 };
191
- const records = toRecords(slice, rows, encoding);
192
- const buffer = buffers.get(slice.table);
193
- if (buffer) for (let i = 0; i < records.length; i++) buffer.push(records[i]);
194
- else buffers.set(slice.table, records);
195
- return { rowCount: records.length };
196
- },
197
- async close() {
198
- const flushed = [];
199
- const failed = [];
200
- if (buffers.size === 0) return {
201
- flushed,
202
- failed
203
- };
204
- const conn = await connect().then((c) => c, (cause) => {
205
- connection = void 0;
206
- return { connectError: cause };
207
- });
208
- if ("connectError" in conn) {
209
- for (const [table, records] of buffers) if (records.length > 0) failed.push({
210
- table,
211
- error: engineErrors.sinkTableFlushFailed(table, conn.connectError)
212
- });
213
- buffers.clear();
214
- return {
215
- flushed,
216
- failed
217
- };
218
- }
219
- for (const [table, records] of buffers) {
220
- if (records.length === 0) continue;
221
- const deduped = sortByClusterKey(table, dedupeByIdentity(table, records));
222
- await icebergAppendRetrying({
223
- catalog: conn.catalog,
224
- namespace: conn.namespace,
225
- table,
226
- resolver: conn.resolver,
227
- records: deduped
228
- }, options.commitRetry).then(() => {
229
- flushed.push(table);
230
- }, (cause) => {
231
- failed.push({
232
- table,
233
- error: engineErrors.sinkTableFlushFailed(table, cause)
234
- });
235
- });
236
- }
237
- buffers.clear();
238
- return {
239
- flushed,
240
- failed
241
- };
242
- }
243
- };
244
- }
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, SEARCH_TYPE_INT, assertIcebergTable, icebergPartitionColumns, icebergSchemasFor, icebergTableSpec, isIcebergTable } from "./schema.mjs";
2
+ import { createIcebergTables, dropIcebergTables, icebergPartitionSpecFor, icebergSchemaFor, icebergSortOrderFor, listIcebergDataFiles } from "./catalog.mjs";
3
+ import { createIcebergAppendSink } from "./append-sink.mjs";
245
4
  export { ICEBERG_FIELD_ID_BASE, ICEBERG_PARTITION_COLUMNS, ICEBERG_PARTITION_SPEC, ICEBERG_SCHEMAS, ICEBERG_SCHEMAS_INT, ICEBERG_SCHEMAS_STRING, ICEBERG_TABLES, INT_SEARCH_TYPE, SEARCH_TYPE_INT, assertIcebergTable, createIcebergAppendSink, createIcebergTables, dropIcebergTables, icebergPartitionColumns, icebergPartitionSpecFor, icebergSchemaFor, icebergSchemasFor, icebergSortOrderFor, icebergTableSpec, isIcebergTable, listIcebergDataFiles };
@@ -0,0 +1,161 @@
1
+ import { Row } from "../storage.mjs";
2
+ import { IcebergS3Config } from "./schema.mjs";
3
+ import { Sink, SinkCloseResult, SliceOverwriteWriter } from "../sink.mjs";
4
+ /** Connection details for the Iceberg REST catalog the writer targets. */
5
+ interface OverwriteWriterCatalogConfig {
6
+ /**
7
+ * Iceberg REST catalog endpoint, e.g. `http://localhost:8181` (POC) or the
8
+ * R2 Data Catalog endpoint (prod).
9
+ */
10
+ catalogUri: string;
11
+ /** Catalog namespace the 5 fact tables live under, e.g. `gsc`. */
12
+ namespace: string;
13
+ /** Warehouse identifier the catalog resolves table locations under. */
14
+ warehouse: string;
15
+ /** S3-compatible object store backing the catalog. */
16
+ s3: IcebergS3Config;
17
+ /** Bearer token for a token-authed REST catalog (R2 Data Catalog). */
18
+ catalogToken?: string;
19
+ }
20
+ /**
21
+ * The JSON job wire-format shared with `scripts/iceberg-writer.py`.
22
+ * `op` is always `overwrite` here.
23
+ */
24
+ interface OverwriteJob {
25
+ op: 'overwrite';
26
+ catalogUri: string;
27
+ namespace: string;
28
+ warehouse: string;
29
+ s3: IcebergS3Config;
30
+ table: string;
31
+ spec: unknown;
32
+ siteId: string;
33
+ searchType: string;
34
+ date: string;
35
+ /** Data columns only — the script injects `site_id` / `search_type`. */
36
+ rows: readonly Row[];
37
+ }
38
+ /**
39
+ * Per-site delete job — removes EVERY row for one `siteId` across a whole
40
+ * table (all dates / search types). Recovery op for clearing a corrupt site
41
+ * (e.g. a cross-run append double) from a shared per-team shard before a clean
42
+ * re-backfill, without touching sibling sites. Carries no rows. `siteId` is a
43
+ * `number` for an INT-encoded shard, a `string` for STRING encoding.
44
+ */
45
+ interface DeleteJob {
46
+ op: 'delete';
47
+ catalogUri: string;
48
+ namespace: string;
49
+ warehouse: string;
50
+ s3: IcebergS3Config;
51
+ /** Bearer token for a token-authed REST catalog (R2 Data Catalog). */
52
+ catalogToken?: string;
53
+ table: string;
54
+ siteId: string | number;
55
+ }
56
+ /** Any job the shared PyIceberg backend can execute. */
57
+ type PyIcebergJob = OverwriteJob | DeleteJob;
58
+ /** Result wire-format from the PyIceberg backend. */
59
+ interface OverwriteJobResult {
60
+ /** Rows written (emit/overwrite) or removed (delete). */
61
+ rowCount?: number;
62
+ error?: string;
63
+ }
64
+ /**
65
+ * A transport that executes one PyIceberg job and returns its result.
66
+ * `subprocessBackend` and `httpBackend` are the two shipped implementations;
67
+ * tests inject a fake. The param is the `OverwriteJob | DeleteJob` union, so a
68
+ * backend value is still assignable where the narrower `OverwriteBackend` is
69
+ * expected (a wider-param function accepts the narrower call).
70
+ */
71
+ type OverwriteBackend = (job: PyIcebergJob) => Promise<OverwriteJobResult>;
72
+ interface IcebergOverwriteWriterOptions {
73
+ catalog: OverwriteWriterCatalogConfig;
74
+ /** The transport that runs the PyIceberg job. */
75
+ backend: OverwriteBackend;
76
+ }
77
+ /**
78
+ * The trailing-window Iceberg overwrite writer. Conforms to the frozen
79
+ * `SliceOverwriteWriter` contract; `overwriteSlice` builds one PyIceberg
80
+ * overwrite job per call and runs it through the configured backend.
81
+ */
82
+ interface IcebergOverwriteWriter extends SliceOverwriteWriter {
83
+ /** Release any backend resources. Idempotent. */
84
+ close: () => Promise<SinkCloseResult>;
85
+ }
86
+ /**
87
+ * Build a trailing-window Iceberg overwrite writer over the given backend.
88
+ * Pure — all I/O is the backend's; the writer only shapes the job.
89
+ */
90
+ declare function createIcebergOverwriteWriter(opts: IcebergOverwriteWriterOptions): IcebergOverwriteWriter;
91
+ /** Options for the PyIceberg subprocess backend. */
92
+ interface SubprocessBackendOptions {
93
+ /** Python interpreter. Defaults to `$GSCDUMP_ICEBERG_PYTHON` then `python3`. */
94
+ python?: string;
95
+ /**
96
+ * Path to the PyIceberg writer script. Defaults to
97
+ * `<engine>/scripts/iceberg-writer.py`.
98
+ */
99
+ writerScript?: string;
100
+ }
101
+ /**
102
+ * Backend that runs the PyIceberg overwrite by spawning the shared writer
103
+ * script (`scripts/iceberg-writer.py`). Node-only — used by local integration
104
+ * tests and a Node-side scheduled job box. The script reads the job JSON on
105
+ * stdin and writes `{rowCount}` / `{error}` on stdout.
106
+ */
107
+ declare function subprocessBackend(opts?: SubprocessBackendOptions): OverwriteBackend;
108
+ /** Options for the PyIceberg HTTP backend (the Cloudflare Container in prod). */
109
+ interface HttpBackendOptions {
110
+ /**
111
+ * URL of the PyIceberg overwrite service — a POST endpoint accepting the
112
+ * `OverwriteJob` JSON and returning `OverwriteJobResult`.
113
+ */
114
+ endpoint: string;
115
+ /** Optional bearer token for the service. */
116
+ token?: string;
117
+ /** Injectable fetch — defaults to the global. */
118
+ fetch?: typeof fetch;
119
+ }
120
+ /**
121
+ * Backend that POSTs the overwrite job to a PyIceberg HTTP service — the
122
+ * Cloudflare Container running `iceberg-writer.py` behind an HTTP shim. This
123
+ * is the prod transport: the request-path Worker holds no Python and never
124
+ * does an Iceberg metadata commit itself.
125
+ */
126
+ declare function httpBackend(opts: HttpBackendOptions): OverwriteBackend;
127
+ /**
128
+ * Adapt an `IcebergOverwriteWriter` into a full `Sink` whose `emit` is also a
129
+ * partition-overwrite — convenient for tests so a single Iceberg writer backs
130
+ * both append and revision paths against the local stack. Prod keeps `emit`
131
+ * on the Pipeline; only `overwriteSlice` delegates here.
132
+ */
133
+ declare function overwriteWriterAsSink(writer: IcebergOverwriteWriter): Sink & SliceOverwriteWriter;
134
+ /** Per-table outcome of a {@link deleteSiteFromShard} run. */
135
+ interface DeleteSiteResult {
136
+ table: string;
137
+ /** Rows removed, when the backend reported a count. */
138
+ rowCount?: number;
139
+ /** Present when this table's delete failed; the sweep continues regardless. */
140
+ error?: string;
141
+ }
142
+ /**
143
+ * Remove every row for one `siteId` from a per-team Iceberg shard, across the
144
+ * given tables. Recovery op: clear a corrupt site (e.g. a cross-run append
145
+ * double) before a clean re-backfill, leaving sibling sites in the shared shard
146
+ * untouched. `site_id` is an identity partition column, so PyIceberg prunes
147
+ * whole data files (no row-level delete files).
148
+ *
149
+ * Runs SEQUENTIALLY (one commit per table at a time) so the per-table catalog
150
+ * commit-rate ceiling is never tripped. A table failure is captured in its
151
+ * result row, not thrown — the sweep always attempts every table so a partial
152
+ * failure is visible and re-runnable (delete is idempotent: re-deleting an
153
+ * already-empty site is a no-op).
154
+ */
155
+ declare function deleteSiteFromShard(args: {
156
+ catalog: OverwriteWriterCatalogConfig;
157
+ backend: OverwriteBackend;
158
+ siteId: string | number;
159
+ tables: readonly string[];
160
+ }): Promise<DeleteSiteResult[]>;
161
+ export { DeleteJob, DeleteSiteResult, HttpBackendOptions, IcebergOverwriteWriter, IcebergOverwriteWriterOptions, OverwriteBackend, OverwriteJob, OverwriteJobResult, OverwriteWriterCatalogConfig, PyIcebergJob, SubprocessBackendOptions, createIcebergOverwriteWriter, deleteSiteFromShard, httpBackend, overwriteWriterAsSink, subprocessBackend };
@@ -0,0 +1,102 @@
1
+ import { resolvePyIcebergPython, runPyIcebergWriter } from "./pyiceberg-runtime.mjs";
2
+ import { ICEBERG_SCHEMAS, assertIcebergTable } from "./schema.mjs";
3
+ function createIcebergOverwriteWriter(opts) {
4
+ const { catalog, backend } = opts;
5
+ async function overwriteSlice(slice, rows) {
6
+ const siteId = slice.ctx.siteId;
7
+ if (!siteId) throw new Error("overwriteSlice: slice.ctx.siteId is required for the Iceberg partition key");
8
+ const table = assertIcebergTable(slice.table);
9
+ const job = {
10
+ op: "overwrite",
11
+ catalogUri: catalog.catalogUri,
12
+ namespace: catalog.namespace,
13
+ warehouse: catalog.warehouse,
14
+ s3: catalog.s3,
15
+ table,
16
+ spec: ICEBERG_SCHEMAS[table],
17
+ siteId,
18
+ searchType: slice.searchType,
19
+ date: slice.date,
20
+ rows
21
+ };
22
+ const res = await backend(job);
23
+ if (res.error) throw new Error(`overwriteSlice: PyIceberg backend failed: ${res.error}`);
24
+ return { rowCount: res.rowCount ?? rows.length };
25
+ }
26
+ return {
27
+ overwriteSlice,
28
+ async close() {
29
+ return {
30
+ flushed: [],
31
+ failed: []
32
+ };
33
+ }
34
+ };
35
+ }
36
+ function subprocessBackend(opts = {}) {
37
+ return async (job) => {
38
+ const { dirname, join } = await import("node:path");
39
+ const { fileURLToPath } = await import("node:url");
40
+ return runPyIcebergWriter({
41
+ python: resolvePyIcebergPython(opts.python),
42
+ script: opts.writerScript ?? join(dirname(fileURLToPath(import.meta.url)), "..", "scripts", "iceberg-writer.py"),
43
+ job,
44
+ label: "iceberg overwrite subprocess",
45
+ processErrorAsParseFailure: true
46
+ });
47
+ };
48
+ }
49
+ function httpBackend(opts) {
50
+ const doFetch = opts.fetch ?? fetch;
51
+ return async (job) => {
52
+ const res = await doFetch(opts.endpoint, {
53
+ method: "POST",
54
+ headers: {
55
+ "content-type": "application/json",
56
+ ...opts.token ? { authorization: `Bearer ${opts.token}` } : {}
57
+ },
58
+ body: JSON.stringify(job)
59
+ });
60
+ if (!res.ok) {
61
+ const body = await res.text().catch(() => "");
62
+ return { error: `HTTP ${res.status}${body ? `: ${body}` : ""}` };
63
+ }
64
+ return await res.json();
65
+ };
66
+ }
67
+ function overwriteWriterAsSink(writer) {
68
+ return {
69
+ capabilities: {
70
+ canOverwrite: true,
71
+ appendOnly: false
72
+ },
73
+ emit: (slice, rows) => writer.overwriteSlice(slice, rows),
74
+ overwriteSlice: (slice, rows) => writer.overwriteSlice(slice, rows),
75
+ close: () => writer.close()
76
+ };
77
+ }
78
+ async function deleteSiteFromShard(args) {
79
+ const { catalog, backend, siteId, tables } = args;
80
+ const results = [];
81
+ for (const table of tables) {
82
+ const res = await backend({
83
+ op: "delete",
84
+ catalogUri: catalog.catalogUri,
85
+ namespace: catalog.namespace,
86
+ warehouse: catalog.warehouse,
87
+ s3: catalog.s3,
88
+ ...catalog.catalogToken ? { catalogToken: catalog.catalogToken } : {},
89
+ table,
90
+ siteId
91
+ }).catch((err) => ({ error: err instanceof Error ? err.message : String(err) }));
92
+ results.push(res.error ? {
93
+ table,
94
+ error: res.error
95
+ } : {
96
+ table,
97
+ rowCount: res.rowCount
98
+ });
99
+ }
100
+ return results;
101
+ }
102
+ export { createIcebergOverwriteWriter, deleteSiteFromShard, httpBackend, overwriteWriterAsSink, subprocessBackend };
@@ -0,0 +1,34 @@
1
+ import process from "node:process";
2
+ const PYICEBERG_PYTHON_ENV = "GSCDUMP_ICEBERG_PYTHON";
3
+ const DEFAULT_PYICEBERG_PYTHON = "python3";
4
+ function resolvePyIcebergPython(override) {
5
+ return override ?? process.env[PYICEBERG_PYTHON_ENV] ?? DEFAULT_PYICEBERG_PYTHON;
6
+ }
7
+ async function runPyIcebergWriter(options) {
8
+ const { execFile } = await import("node:child_process");
9
+ return new Promise((resolve, reject) => {
10
+ execFile(options.python, [options.script], { maxBuffer: 64 * 1024 * 1024 }, (err, stdout, stderr) => {
11
+ let parsed;
12
+ let parseError;
13
+ if (stdout.trim()) try {
14
+ parsed = JSON.parse(stdout);
15
+ } catch (error) {
16
+ parseError = error;
17
+ }
18
+ if (parsed && !(err && options.rejectOnProcessError)) {
19
+ resolve(parsed);
20
+ return;
21
+ }
22
+ if (err) {
23
+ if (options.processErrorAsParseFailure) {
24
+ reject(/* @__PURE__ */ new Error(`${options.label} produced no parseable output (${err.message})${stderr ? `: ${stderr}` : ""}`));
25
+ return;
26
+ }
27
+ reject(/* @__PURE__ */ new Error(`${options.label} process failed (${err.message})${stderr ? `: ${stderr}` : ""}`));
28
+ return;
29
+ }
30
+ reject(new Error(`${options.label} produced no parseable output: ${stdout || stderr}`, { cause: parseError }));
31
+ }).stdin?.end(JSON.stringify(options.job));
32
+ });
33
+ }
34
+ export { resolvePyIcebergPython, runPyIcebergWriter };
@@ -0,0 +1,69 @@
1
+ import { SearchType } from "../storage.mjs";
2
+ import { IcebergColumn, IcebergPartitionField, IcebergS3Config, IcebergTableSpec, PartitionKeyEncoding, PartitionKeyEncoding as PartitionKeyEncoding$1 } from "@gscdump/lakehouse/schema";
3
+ import { TableName } from "@gscdump/contracts";
4
+ /** The 9 fact tables that exist as global Iceberg tables. */
5
+ type IcebergTableName = Extract<TableName, 'pages' | 'queries' | 'countries' | 'page_queries' | 'dates' | 'search_appearance' | 'search_appearance_pages' | 'search_appearance_queries' | 'search_appearance_page_queries'>;
6
+ /** The 9 Iceberg table names, in canonical order. */
7
+ declare const ICEBERG_TABLES: readonly IcebergTableName[];
8
+ /**
9
+ * Stable `search_type` enum → int map for `'int'`-encoded catalogs. Engine-owned
10
+ * and FROZEN: never renumber or reuse an id (it's the on-disk partition value).
11
+ */
12
+ declare const SEARCH_TYPE_INT: Record<SearchType, number>;
13
+ /** Reverse of {@link SEARCH_TYPE_INT} — int → `search_type`, for read-result mapping. */
14
+ declare const INT_SEARCH_TYPE: Record<number, SearchType>;
15
+ /**
16
+ * The two partition-identity columns Iceberg rows carry that the legacy
17
+ * parquet path encoded in the object-key prefix instead. Field ids 1–2 are
18
+ * the first two columns; per-table metric/dimension columns follow
19
+ * contiguously from id 3 (see `ICEBERG_FIELD_ID_BASE`).
20
+ */
21
+ declare const ICEBERG_PARTITION_COLUMNS: readonly IcebergColumn[];
22
+ /**
23
+ * The two partition-identity columns for a given {@link PartitionKeyEncoding}.
24
+ * `'string'` returns {@link ICEBERG_PARTITION_COLUMNS} verbatim; `'int'` swaps
25
+ * BOTH to INT — `site_id` (the app's small `user_sites.int_id`; ≪ 2.1B sites, so
26
+ * INT is ample) and `search_type` (its fixed enum code). Integer identity columns
27
+ * avoid R2 SQL's truncated-string-stats equality undercount and restore pruning.
28
+ * Field ids are unchanged (1, 2) — only the column types differ.
29
+ */
30
+ declare function icebergPartitionColumns(encoding?: PartitionKeyEncoding): readonly IcebergColumn[];
31
+ /**
32
+ * First field id used for per-table (non-partition) columns — immediately
33
+ * after the two partition-identity columns (`site_id`=1, `search_type`=2).
34
+ * No longer read by `defineDataset` below (field ids are now assigned by
35
+ * `defineIcebergDataset` itself, identity-then-dims-then-columns) — kept as a
36
+ * documented, byte-identity-tested constant for existing external readers.
37
+ */
38
+ declare const ICEBERG_FIELD_ID_BASE = 3;
39
+ /** Shared partition spec — identical across every table. */
40
+ declare const ICEBERG_PARTITION_SPEC: readonly IcebergPartitionField[];
41
+ /**
42
+ * Derive the full Iceberg table spec for a table + encoding. Thin wrapper
43
+ * over {@link gscDataset}'s `tableSpec` (ADR-0021 R2-FIXES C5) — kept as a
44
+ * named GSC-specific export. Generic schema authoring types are owned by
45
+ * `@gscdump/lakehouse`.
46
+ *
47
+ * CONTRACT NOTE: implementation agents must treat the RETURNED VALUE as the
48
+ * source of truth — do not hand-list columns elsewhere.
49
+ */
50
+ declare function icebergTableSpec(table: IcebergTableName, encoding?: PartitionKeyEncoding): IcebergTableSpec;
51
+ /** All Iceberg table specs in legacy `'string'` encoding, keyed by table name. */
52
+ declare const ICEBERG_SCHEMAS_STRING: Record<IcebergTableName, IcebergTableSpec>;
53
+ /** All Iceberg table specs in `'int'` encoding (INT site_id + INT search_type). */
54
+ declare const ICEBERG_SCHEMAS_INT: Record<IcebergTableName, IcebergTableSpec>;
55
+ /** All Iceberg table specs for the default new-catalog encoding. */
56
+ declare const ICEBERG_SCHEMAS: Record<IcebergTableName, IcebergTableSpec>;
57
+ /** Table specs for the given encoding (`'int'` default). */
58
+ declare function icebergSchemasFor(encoding?: PartitionKeyEncoding): Record<IcebergTableName, IcebergTableSpec>;
59
+ /** True when `table` is one of the canonical {@link ICEBERG_TABLES}. */
60
+ declare function isIcebergTable(table: string): table is IcebergTableName;
61
+ /**
62
+ * Narrow an arbitrary table name to a canonical {@link IcebergTableName},
63
+ * throwing a clear error otherwise. Guards write paths that index
64
+ * `ICEBERG_SCHEMAS` (a `Record<IcebergTableName, …>`) — a non-canonical name
65
+ * silently yields `undefined` there, propagating a corrupt/empty spec into the
66
+ * Iceberg job instead of failing loudly.
67
+ */
68
+ declare function assertIcebergTable(table: string): IcebergTableName;
69
+ 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 IcebergS3Config, IcebergTableName, type PartitionKeyEncoding$1 as PartitionKeyEncoding, SEARCH_TYPE_INT, type SearchType, assertIcebergTable, icebergPartitionColumns, icebergSchemasFor, icebergTableSpec, isIcebergTable };
@@ -1,4 +1,5 @@
1
- import { SCHEMAS, TABLE_METADATA } from "./schema.mjs";
1
+ import { TABLE_METADATA } from "../drizzle-schema.mjs";
2
+ import { SCHEMAS } from "../schema.mjs";
2
3
  import { defineIcebergDataset } from "@gscdump/lakehouse";
3
4
  import { DEFAULT_PARTITION_KEY_ENCODING, DEFAULT_PARTITION_KEY_ENCODING as DEFAULT_PARTITION_KEY_ENCODING$1 } from "@gscdump/lakehouse/schema";
4
5
  function mapColumnType(t) {
@@ -124,4 +125,4 @@ function assertIcebergTable(table) {
124
125
  if (!isIcebergTable(table)) throw new Error(`Unknown Iceberg table '${table}'. Expected one of: ${ICEBERG_TABLES.join(", ")}`);
125
126
  return table;
126
127
  }
127
- export { DEFAULT_PARTITION_KEY_ENCODING$1 as DEFAULT_PARTITION_KEY_ENCODING, ICEBERG_FIELD_ID_BASE, ICEBERG_PARTITION_COLUMNS, ICEBERG_PARTITION_SPEC, ICEBERG_SCHEMAS, ICEBERG_SCHEMAS_INT, ICEBERG_SCHEMAS_STRING, ICEBERG_TABLES, INT_SEARCH_TYPE, SEARCH_TYPE_INT, assertIcebergTable, gscDataset, icebergPartitionColumns, icebergSchemasFor, icebergTableSpec, isIcebergTable };
128
+ export { DEFAULT_PARTITION_KEY_ENCODING$1 as DEFAULT_PARTITION_KEY_ENCODING, GSC_DATASETS_INT, GSC_DATASETS_STRING, ICEBERG_FIELD_ID_BASE, ICEBERG_PARTITION_COLUMNS, ICEBERG_PARTITION_SPEC, ICEBERG_SCHEMAS, ICEBERG_SCHEMAS_INT, ICEBERG_SCHEMAS_STRING, ICEBERG_TABLES, INT_SEARCH_TYPE, SEARCH_TYPE_INT, assertIcebergTable, gscDataset, icebergPartitionColumns, icebergSchemasFor, icebergTableSpec, isIcebergTable };