You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm believe there's a bug somewhere in the generate_view_statement function in core.py, more specifically in how the sources column in the above records is parse and turned into a view. Here's the view SQL generated by generate_view_statement, this SQL does not compile in BigQuery:
SELECT
JSON_VALUE(data, '$.id') as`id`,
JSON_VALUE(data, '$.participant_id') as`participant_id`,
JSON_VALUE(data, '$.participant_type') as`participant_type`,
JSON_VALUE(data, '$.message_channel_id') as`message_channel_id`,
CAST(JSON_VALUE(data, '$.created_at') asTIMESTAMP) as`created_at`,
CAST(JSON_VALUE(data, '$.updated_at') asTIMESTAMP) as`updated_at`,
CAST(JSON_VALUE(data, '$.discarded_at') asTIMESTAMP) as`discarded_at`,
ARRAY(
SELECT CAST(JSON_VALUE(sources__rows, '$.sources') as JSON) as`sources`FROM UNNEST(
JSON_QUERY_ARRAY(data, '$.sources')
) AS sources__rows
WHERE CAST(JSON_VALUE(sources__rows, '$.sources') as JSON) IS NOT NULL
) AS sources,
JSON_VALUE(data, '$.discarded_reason') as`discarded_reason`,
JSON_VALUE(data, '$.created_by_id') as`created_by_id`,
_sdc_batched_at as _sdc_batched_at,
_sdc_extracted_at as _sdc_extracted_at,
_sdc_deleted_at as _sdc_deleted_at,
_sdc_received_at as _sdc_received_at,
_sdc_table_version as _sdc_table_version,
_sdc_sequence as _sdc_sequence,
FROM`analytics-384214`.`source_arc_postgres_dev`.`public_channel_participants`
Here's the error I get when i copy/paste the generated SQL into BigQuery:
The error goes away when I set generate_view to false. However, this isn't ideal because the data is of course much easier to work with if denormalized.
Let me know if there's any other context I can provide! I would like to be able to use the package with generate_view: true.
The text was updated successfully, but these errors were encountered:
I'm running into an issue where this BigQuery target is unable to load data which contains nested JSON.
I have the following config:
Here's a small sample of the data coming from
tap-postgres
:Here are the errors from the logs when i run
meltano run tap-postgres target-bigquery
:I'm believe there's a bug somewhere in the
generate_view_statement
function in core.py, more specifically in how the sources column in the above records is parse and turned into a view. Here's the view SQL generated bygenerate_view_statement
, this SQL does not compile in BigQuery:Here's the error I get when i copy/paste the generated SQL into BigQuery:
The error goes away when I set
generate_view
to false. However, this isn't ideal because the data is of course much easier to work with if denormalized.Let me know if there's any other context I can provide! I would like to be able to use the package with
generate_view: true
.The text was updated successfully, but these errors were encountered: