fix(bigquery-jdbc): handle EXPORT DATA, EXPORT MODEL, and LOAD DATA statements#13267
fix(bigquery-jdbc): handle EXPORT DATA, EXPORT MODEL, and LOAD DATA statements#13267keshavdandeva wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for the EXPORT SQL type in the BigQuery JDBC driver. It maps the EXPORT_DATA statement to a new EXPORT SqlType, and handles the query results for this type in BigQueryStatement by updating the affected row count based on the export statistics. The review feedback suggests improving robustness by adding null checks, validating the type before casting JobStatistics, and restoring the thread's interrupted status when catching InterruptedException.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for handling EXPORT_DATA statements in the BigQuery JDBC driver. It adds a new EXPORT SQL type, maps EXPORT_DATA to this type, and implements logic in BigQueryStatement to wait for the export job to complete and extract the affected row count from the job statistics. I have no feedback to provide as there are no review comments.
b/510498449
This PR resolves an issue where executing
EXPORT DATA,EXPORT MODEL, orLOAD DATAstatements triggered aBigQueryJdbcException: Unexpected value: OTHER. These statement types were mapped toOTHERinBigQuerySqlTypeConverter, which was unhandled inBigQueryStatement.java.1.
EXPORT_DATASqlType.EXPORTand added a specific handler.QueryStatistics.ExportDataStats.getRowCount(). We now fetch this job statistic and return it as the update count, providing full functionality for this statement.2.
EXPORT_MODELSqlType.DDLQueryStatistics. Treating it as DDL allows it to execute successfully and return0as the update count, which is appropriate.3.
LOAD_DATASqlType.DDLLOAD DATAexecutes as a Query Job. The resultingQueryStatisticsdo not expose load statistics directly (unlikeExportDataStats). While we could potentially find the count by inspecting child jobs, mapping it toDDLallows it to succeed immediately and return0, resolving the blocking error with minimal overhead.