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

Support writing NUMERIC and BIGNUMERIC types in BigQuery #16145

Merged

Conversation

vlad-lyutenko
Copy link
Contributor

@vlad-lyutenko vlad-lyutenko commented Feb 16, 2023

Description

Support writing NUMERIC and BIGNUMERIC types in BigQuery

Additional context and related issues

Release notes

(x) Release notes are required, with the following suggested text:

# BigQuery
* Add support for writing BigQuery `numeric` and `bignumeric` types. ({issue}`16145`)

@cla-bot cla-bot bot added the cla-signed label Feb 16, 2023
// TODO https://github.com/trinodb/trino/issues/13741 Add support for decimal, time, timestamp with time zone, geography, map type
// TODO https://github.com/trinodb/trino/issues/13741 Add support for time, timestamp with time zone, geography, map type
if (type instanceof DecimalType) {
return readBigDecimal((DecimalType) type, block, position).toString();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we pass here as BigDecimal - it's rounded

@ebyhr
Copy link
Member

ebyhr commented Feb 17, 2023

/test-with-secrets sha=0065d9bc28865cdcdc3293ef388a3bc91e34be02

@ebyhr ebyhr added the bigquery BigQuery connector label Feb 17, 2023
@github-actions
Copy link

The CI workflow run with tests that require additional secrets finished as failure: https://github.com/trinodb/trino/actions/runs/4200631454

@vlad-lyutenko vlad-lyutenko force-pushed the vlad-lyutenko/bignumeric-write-support branch from 0065d9b to 0b6b4fc Compare February 17, 2023 11:37
@github-actions github-actions bot added the docs label Feb 17, 2023
@vlad-lyutenko vlad-lyutenko force-pushed the vlad-lyutenko/bignumeric-write-support branch from 0b6b4fc to b6ceb4e Compare February 17, 2023 14:32
@ebyhr
Copy link
Member

ebyhr commented Feb 17, 2023

/test-with-secrets sha=b6ceb4e170fdc22655e770895f2d99bbe99da2e9

@github-actions
Copy link

The CI workflow run with tests that require additional secrets finished as failure: https://github.com/trinodb/trino/actions/runs/4204994076

@@ -651,6 +713,11 @@ private DataSetup bigqueryCreateAndInsert(String tableNamePrefix)
return new CreateAndInsertDataSetup(getBigQuerySqlExecutor(), tableNamePrefix);
}

private DataSetup bigqueryCreateAndTrinoInsert(String tableNamePrefix)
{
return new BigQueryCreateAndTrinoInsertDataSetup(new TrinoSqlExecutor(getQueryRunner(), getSession()), getBigQuerySqlExecutor(), tableNamePrefix);
Copy link
Member

Choose a reason for hiding this comment

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

BigQueryCreateAndTrinoInsertDataSetup isn't necessary:

return new CreateAndTrinoInsertDataSetup(getBigQuerySqlExecutor(), new TrinoSqlExecutor(getQueryRunner()), tableNamePrefix);

@ebyhr ebyhr force-pushed the vlad-lyutenko/bignumeric-write-support branch from b6ceb4e to faa0870 Compare February 18, 2023 00:05
@ebyhr ebyhr force-pushed the vlad-lyutenko/bignumeric-write-support branch from faa0870 to 3d88193 Compare February 18, 2023 01:26
@ebyhr ebyhr force-pushed the vlad-lyutenko/bignumeric-write-support branch from 3d88193 to f44db01 Compare February 18, 2023 04:54
@ebyhr ebyhr merged commit 8cfa24c into trinodb:master Feb 18, 2023
@ebyhr ebyhr mentioned this pull request Feb 18, 2023
@github-actions github-actions bot added this to the 408 milestone Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants