Skip to content

[PLUGIN-1563] Add support in BQ Source to read JSON columns#1391

Merged
itsankit-google merged 1 commit intodata-integrations:developfrom
cloudsufi:patch/bq-source-json-support
Apr 19, 2024
Merged

[PLUGIN-1563] Add support in BQ Source to read JSON columns#1391
itsankit-google merged 1 commit intodata-integrations:developfrom
cloudsufi:patch/bq-source-json-support

Conversation

@psainics
Copy link
Copy Markdown
Contributor

@psainics psainics commented Mar 29, 2024

Add support in BQ Source to read JSON columns

Jira : PLUGIN-1563

Description

This PR adds the ability to read columns with JSON columns.
We treat Json type as a string.

UI Field

  • No Changes made to widget json.

Docs

  • No Changes made to docs.

Code change

  • Modified BigQueryUtil.java

Unit Tests

  • Modified BigQueryUtilTest.java
    • Added new Unit Test testConvertFieldTypeJsonToString
image

@psainics psainics force-pushed the patch/bq-source-json-support branch from d68eb2c to f6cd4bf Compare March 29, 2024 05:27
@psainics psainics added the build Trigger unit test build label Mar 29, 2024
@psainics psainics force-pushed the patch/bq-source-json-support branch 2 times, most recently from 8728d58 to 814b86a Compare March 29, 2024 17:29
@psainics psainics force-pushed the patch/bq-source-json-support branch 2 times, most recently from c36dcc6 to b75bbcd Compare April 19, 2024 08:13
Comment on lines +162 to +164
LegacySQLTypeName typeJson = LegacySQLTypeName.valueOf("JSON");
// Treat JSON as string
StandardSQLTypeName standardType = type.equals(typeJson) ? StandardSQLTypeName.STRING : type.getStandardType();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this looks more readable

StandardSQLTypeName standardType = LegacySQLTypeName.valueOf("JSON").equals(type) ? 
StandardSQLTypeName.STRING : type.getStandardType();

@psainics psainics force-pushed the patch/bq-source-json-support branch from b75bbcd to 47001d9 Compare April 19, 2024 12:27
@psainics psainics force-pushed the patch/bq-source-json-support branch from 47001d9 to 8cfba20 Compare April 19, 2024 12:31
@itsankit-google itsankit-google merged commit 54077e6 into data-integrations:develop Apr 19, 2024
@psainics psainics deleted the patch/bq-source-json-support branch February 13, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Trigger unit test build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants