rivet-cli 0.20.0

Rivet: PostgreSQL/MySQL/SQL Server/MongoDB → Parquet/CSV (local, S3, GCS, Azure). Crate name rivet-cli; binary rivet.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
# Generated by rivet init — MySQL database "rivet" (26 objects)
# Review and adjust before running: rivet check -c rivet.yaml

source:
  type: mysql
  url_env: DATABASE_URL  # reads the variable you already exported

# One export per table/view — per-table prefix `exports/<name>/` under the given bucket; review
# modes before running.
exports:
  - name: bench_decimal
    wave: 3
    parallel_safe: false
    query: >
      SELECT id, price, qty, discount, total, updated_at
      FROM bench_decimal
    # auto: ~183K rows ≥ 100K threshold and chunk column 'id' is available. NOTE: chunked re-reads
    # the whole table each run — for scheduled re-runs, `mode: incremental` on 'updated_at' pulls
    # only changed rows
    mode: chunked
    chunk_column: id
    chunk_size: 100000
    chunk_checkpoint: true  # record per-chunk progress so `rivet run --resume` can finish a crashed
    # run
    format: parquet
    parquet:
      row_group_strategy: auto
      target_row_group_mb: 128
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/bench_decimal/
    columns:
      price: decimal(18,4)
      qty: decimal(10,2)
      discount: decimal(5,4)
      total: decimal(20,4)
  - name: bench_hc
    wave: 3
    parallel_safe: false
    query: >
      SELECT id, uuid_col, email, session_id, updated_at
      FROM bench_hc
    # auto: ~190K rows ≥ 100K threshold and chunk column 'id' is available. NOTE: chunked re-reads
    # the whole table each run — for scheduled re-runs, `mode: incremental` on 'updated_at' pulls
    # only changed rows
    mode: chunked
    chunk_column: id
    chunk_size: 100000
    chunk_checkpoint: true  # record per-chunk progress so `rivet run --resume` can finish a crashed
    # run
    format: parquet
    parquet:
      row_group_strategy: auto
      target_row_group_mb: 128
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/bench_hc/
  - name: bench_narrow
    wave: 4
    parallel_safe: false
    query: >
      SELECT id, user_id, amount, status, created_at
      FROM bench_narrow
    # auto: ~9.8M rows ≥ 100K threshold and chunk column 'id' is available. NOTE: chunked re-reads
    # the whole table each run — for scheduled re-runs, `mode: incremental` on 'created_at' pulls
    # only changed rows
    mode: chunked
    chunk_column: id
    chunk_size: 250000
    chunk_checkpoint: true  # record per-chunk progress so `rivet run --resume` can finish a crashed
    # run
    # est. peak RSS ≈ 92 MB (4 workers × ~19 MB/worker @ ~51 B/row); lower `parallel` to spend less
    # memory
    parallel: 4
    format: parquet
    parquet:
      row_group_strategy: auto
      target_row_group_mb: 128
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/bench_narrow/
  - name: bench_sparse
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, val_a, val_b, val_c, val_d, val_e, updated_at
      FROM bench_sparse
    # auto: ~9K rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/bench_sparse/
  - name: bench_wide
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, col_a, col_b, col_c, col_d, col_e, col_f, col_g, col_h, col_i, col_j, updated_at
      FROM bench_wide
    # auto: ~82K rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/bench_wide/
  - name: cdc_demo
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, name, amount
      FROM cdc_demo
    # auto: ~2 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_demo/
  - name: cdc_e2e
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, name, amount
      FROM cdc_e2e
    # auto: ~0 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_e2e/
  - name: cdc_f
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, v
      FROM cdc_f
    # auto: ~0 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_f/
  - name: cdc_m
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, name
      FROM cdc_m
    # auto: ~2 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_m/
  - name: cdc_reg
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, amount
      FROM cdc_reg
    # auto: ~0 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_reg/
    columns:
      amount: decimal(10,2)
  - name: cdc_resume
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, v
      FROM cdc_resume
    # auto: ~2 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_resume/
  - name: cdc_sec
    wave: 2
    parallel_safe: true
    query: >
      SELECT id
      FROM cdc_sec
    # auto: ~0 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_sec/
  - name: cdc_tx
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, v
      FROM cdc_tx
    # auto: ~2 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_tx/
  - name: cdc_typed
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, name, ts, amount
      FROM cdc_typed
    # auto: ~0 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_typed/
    columns:
      amount: decimal(10,2)
  - name: cdc_unit
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, v
      FROM cdc_unit
    # auto: ~0 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/cdc_unit/
  - name: ck_dec_my
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, amount, fee, neg
      FROM ck_dec_my
    # auto: ~4 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/ck_dec_my/
    columns:
      amount: decimal(18,2)
      fee: decimal(20,6)
      neg: decimal(10,2)
  - name: content_items
    wave: 3
    parallel_safe: false
    query: >
      SELECT id, title, body, raw_html, metadata, tags, author_name, author_email, source_url, category, status, priority, view_count, comment_count, word_count, language, published_at, updated_at, created_at, extra_data
      FROM content_items
    # auto: ~1.3M rows ≥ 100K threshold and chunk column 'id' is available. NOTE: chunked re-reads
    # the whole table each run — for scheduled re-runs, `mode: incremental` on 'updated_at' pulls
    # only changed rows
    mode: chunked
    chunk_column: id
    chunk_size: 250000
    chunk_checkpoint: true  # record per-chunk progress so `rivet run --resume` can finish a crashed
    # run
    # parallel: 1 (wide rows on MySQL: single scan is faster than chunks)
    format: parquet
    parquet:
      row_group_strategy: auto
      target_row_group_mb: 64
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/content_items/
  - name: events
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, user_id, event_type, payload, ip_address, created_at
      FROM events
    # auto: ~5K rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/events/
  - name: orders
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, user_id, product, quantity, price, status, notes, ordered_at, updated_at
      FROM orders
    # auto: ~2K rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/orders/
    columns:
      price: decimal(10,2)
  - name: orders_coalesce
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, product, quantity, price, updated_at, created_at
      FROM orders_coalesce
    # auto: ~0 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/orders_coalesce/
    columns:
      price: decimal(10,2)
  - name: orders_sparse
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, payload
      FROM orders_sparse
    # auto: ~0 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/orders_sparse/
  - name: page_views
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, session_id, user_id, url, referrer, user_agent, ip_address, country_code, region, city, device_type, browser, os, screen_width, screen_height, viewport_width, viewport_height, page_load_ms, dom_ready_ms, time_on_page_ms, scroll_depth_pct, click_count, is_bounce, utm_source, utm_medium, utm_campaign, utm_term, utm_content, custom_props, created_at
      FROM page_views
    # auto: ~60K rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/page_views/
  - name: rivet_harm
    wave: 2
    parallel_safe: true
    query: >
      SELECT txn_ms, q_s, active, sessions
      FROM rivet_harm
    # auto: ~7K rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/rivet_harm/
  - name: rivet_type_matrix
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, label, amount, fee, created_at_dt, created_at_ts, raw_bytes, uid, extras
      FROM rivet_type_matrix
    # auto: ~4 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/rivet_type_matrix/
    columns:
      amount: decimal(18,2)
      fee: decimal(18,6)
  - name: rivet_type_matrix_full
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, flag, bit1_col, bit8_col, tiny_col, date_col, time_col, year_col, enum_col, varbinary_col, blob_col
      FROM rivet_type_matrix_full
    # auto: ~3 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/rivet_type_matrix_full/
  - name: users
    wave: 2
    parallel_safe: true
    query: >
      SELECT id, name, email, age, balance, is_active, bio, created_at, updated_at
      FROM users
    # auto: ~500 rows below 100K chunked threshold
    mode: full
    format: parquet
    meta_columns:  # adds 2 columns to the output (drop this block to omit them)
      exported_at: true  # _rivet_exported_at: when the row was exported
      row_hash: true  # _rivet_row_hash: per-row hash for change detection
    destination:
      type: gcs
      bucket: rivet_data_test
      prefix: exports/users/
    columns:
      balance: decimal(12,2)