Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HStore Support for BigQuery #995

Merged
merged 13 commits into from
Jan 10, 2024
Merged

HStore Support for BigQuery #995

merged 13 commits into from
Jan 10, 2024

Conversation

Amogh-Bharadwaj
Copy link
Contributor

@Amogh-Bharadwaj Amogh-Bharadwaj commented Jan 5, 2024

Maps HStore to JSON in BigQuery.
Achieves this by transforming '"a"=>"b"' to {"a":"b"} via string functions, in both qrep/initial load and cdc
Test added

Relies on the fact hstore key and value must be quoted strings (although the key can be empty and this case is supported)
And follows the syntax in the example above

postgres=# select 'a'::hstore;
ERROR:  Unexpected end of string
LINE 1: select 'a'::hstore;
               ^
postgres=# select 'a=>b'::hstore;
-[ RECORD 1 ]----
hstore | "a"=>"b"

postgres=# select 'a=>'::hstore;
ERROR:  Unexpected end of string
LINE 1: select 'a=>'::hstore;

postgres=# select 'a=>3434'::hstore;
-[ RECORD 1 ]-------
hstore | "a"=>"3434"

serprex
serprex previously approved these changes Jan 5, 2024
@serprex serprex self-requested a review January 5, 2024 22:29
@serprex serprex dismissed their stale review January 5, 2024 22:35

string replace unsafe

@Amogh-Bharadwaj Amogh-Bharadwaj merged commit 595749d into main Jan 10, 2024
@serprex serprex deleted the datatypes/bq-hstore branch July 19, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants