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

BigQueryException: no such function: zetasqlite_unary_minus" #217

Open
SButterfly opened this issue Jul 27, 2023 · 1 comment · May be fixed by goccy/go-zetasqlite#206
Open

BigQueryException: no such function: zetasqlite_unary_minus" #217

SButterfly opened this issue Jul 27, 2023 · 1 comment · May be fixed by goccy/go-zetasqlite#206
Labels
bug Something isn't working

Comments

@SButterfly
Copy link

How to reproduce

I am using java gcloud SDK

            bigQuery.create(DatasetInfo.of("temp"));
            bigQuery.create(TableInfo.of(TableId.of("temp", "countries"), StandardTableDefinition.of(
                Schema.of(
                    Field.newBuilder("population", StandardSQLTypeName.INT64).build(),
                    Field.newBuilder("gender", StandardSQLTypeName.STRING).build()
                )
            )));
            bigQuery.create(TableInfo.of(TableId.of("temp", "result"), StandardTableDefinition.of(
                Schema.of(Field.newBuilder("diff", StandardSQLTypeName.INT64).build())
            )));
            bigQuery.query(QueryJobConfiguration.newBuilder("" +
                "SELECT SUM(CASE WHEN gender = 'MALE' THEN -population ELSE population END) as diff\n" +
                "FROM `temp.countries` " +
                "GROUP BY gender"
            ).build());

Failed with

Caused by: com.google.cloud.bigquery.BigQueryException: failed to query SELECT SUM(CASE WHEN gender = 'MALE' THEN -population ELSE population END) as diff
FROM `temp.countries` GROUP BY gender: no such function: zetasqlite_unary_minus
	at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.translate(HttpBigQueryRpc.java:115)
	at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.queryRpc(HttpBigQueryRpc.java:720)
	at com.google.cloud.bigquery.BigQueryImpl$35.call(BigQueryImpl.java:1322)
	at com.google.cloud.bigquery.BigQueryImpl$35.call(BigQueryImpl.java:1319)
	at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:103)
	at com.google.cloud.bigquery.BigQueryRetryHelper.run(BigQueryRetryHelper.java:86)
	at com.google.cloud.bigquery.BigQueryRetryHelper.runWithRetries(BigQueryRetryHelper.java:49)
	at com.google.cloud.bigquery.BigQueryImpl.queryRpc(BigQueryImpl.java:1318)
	at com.google.cloud.bigquery.BigQueryImpl.query(BigQueryImpl.java:1306)
	at com.payaut.report.AbstractDBIntegrationTest$Initializer.initialize(AbstractDBIntegrationTest.java:52)
	at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:604)
	at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:373)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)
	at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:136)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
	... 72 more
@totem3 totem3 added the bug Something isn't working label Dec 11, 2023
@ineslourencom
Copy link

having the same issue here. I appreciate any development of this ticket. Cheers

@totem3 totem3 linked a pull request Apr 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants