dylan_just
08/17/2026, 3:44 AMaaron_phethean
09/02/2026, 12:05 PMdylan_just
09/02/2026, 11:15 PMstate merge to set the state back to epoch, then a truncate table, then runs the job as normal. The affected table then runs an incremental as normal, but from scratch. Works well.
I'm "orchestrating" just with a shell script and running all taps in one go. I think the --full-refresh flag doesn't quite do what I need - I think it'd refresh all streams, which would be too slow for my data size. I can only handle the full refresh on certain tables.
I'm wondering how we could make Meltano better handle my scenario. Perhaps if --full-refresh took a parameter that selects what taps and streams to refresh?
For reference, here's the relevant parts of my orchestration script:
if [ "${FULL_TABLE_SWEEP:-}" = "true" ]; then
STATE_ID="$MELTANO_ENVIRONMENT:tap-hamilton-v1-to-$LOADER"
echo "Rewinding public-invitation and public-user, then emptying their raw tables" >&2
uv run meltano "$ENV_ARG" state merge "$STATE_ID" '{"singer_state": {"bookmarks": {
"public-invitation": {"replication_key_value": 0},
"public-user": {"replication_key_value": "1970-01-01T00:00:00+00:00"}}}}'
REWOUND_STATE="$(uv run meltano "$ENV_ARG" state get "$STATE_ID")"
if ! grep -qF '"replication_key_value":0' <<<"$REWOUND_STATE" ||
! grep -qF '"replication_key_value":"1970-01-01T00:00:00+00:00"' <<<"$REWOUND_STATE"; then
echo "Error: bookmarks did not read back as rewound; refusing to truncate." >&2
exit 1
fi
PGPASSWORD="$WAREHOUSE_MELTANO_PASSWORD" psql \
--host="$WAREHOUSE_HOST" --port="$WAREHOUSE_PORT" \
--username=meltano_user --dbname="$WAREHOUSE_DBNAME" \
--set=ON_ERROR_STOP=1 \
--command='truncate table raw_hamilton.invitation, raw_hamilton."user"'
fi
echo "Running ${TAPS[*]} -> $LOADER then dbt-postgres:build ($ENV_ARG)" >&2
uv run meltano "$ENV_ARG" run "${BLOCKS[@]}" dbt-postgres:build