Skip to content

Commit

Permalink
Support BATCH message stream aliasing via stream maps
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenFrankel committed Sep 12, 2024
1 parent 3819961 commit 9c96860
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tap_bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from google.cloud import bigquery
from singer_sdk import SQLStream
from singer_sdk.helpers import types
from singer_sdk.helpers._batch import JSONLinesEncoding
from singer_sdk.helpers._batch import JSONLinesEncoding, SDKBatchMessage

from tap_bigquery.connector import BigQueryConnector

Expand Down Expand Up @@ -136,3 +136,14 @@ def get_records(self, partition: dict | None) -> Iterable[dict[str, Any]]:
return None

yield from super().get_records(partition)

def _write_batch_message(self, encoding, manifest):
for stream_map in self.stream_maps:
self._tap.write_message(
SDKBatchMessage(
stream=stream_map.stream_alias,
encoding=encoding,
manifest=manifest,
),
)
self._is_state_flushed = False

0 comments on commit 9c96860

Please sign in to comment.