[bigquery-jdbc] Expose dry-run / query cost estimation API

未關閉
#14,264 0 則留言 1 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@logachev 已經在處理了。

開始於 2026年9月10日。

評估

這個 Issue 還沒有評估資料。

描述

Problem

BigQuery clients often need to estimate the amount of data a query will process before executing it, because BigQuery billing depends on bytes processed.

The BigQuery API supports this through dry runs and returns totalBytesProcessed. The Java BigQuery client also exposes this capability, including Connection.dryRun(String) / BigQueryDryRunResult.

However, google-cloud-bigquery-jdbc does not currently expose an equivalent public API through BigQueryConnection or BigQueryStatement.

This prevents JDBC-based database tools such as DataGrip from providing the same pre-execution cost information that the BigQuery Console provides.

Requested API

It would be useful to expose dry-run/query estimation as a BigQuery-specific JDBC extension, for example through an unwrapped BigQueryConnection or BigQueryStatement:

BigQueryStatement statement =
    jdbcStatement.unwrap(BigQueryStatement.class);

BigQueryDryRunResult result = statement.dryRun(sql);
long bytes = result.getTotalBytesProcessed();

The exact API shape is not important; the main requirement is to perform the dry run using the existing JDBC connection configuration and authentication.

Ideally it should preserve:

  • authentication/credentials
  • project
  • location
  • default dataset
  • session configuration
  • prepared-statement parameters, where applicable
Motivation

For database IDEs and other JDBC tools, this would allow:

This query will process approximately 1.8 TB.

to be shown before execution, optionally allowing clients to warn users about unexpectedly expensive queries.

MaximumBytesBilled is useful as a hard safety limit, but it does not expose the estimated number of bytes to the JDBC client before execution.

The underlying BigQuery APIs already provide dry-run estimation, so this request is specifically about making that capability accessible through the JDBC driver.

主要語言
Java
星號
2.1k
分支
1.2k
平均合併
2 天 14 小時
30 天內合併 PR
192

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

googleapis/google-cloud-java 的其他 Issue

查看 googleapis/google-cloud-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。