Closed kaklakariada closed 2 years ago
Thank you for your request. First, path prefix will resolve with this fixes . https://github.com/goccy/bigquery-emulator/pull/8/files#diff-78f42ba40d0f10b08c73b7e6bb8376f398e249c963cf549e89591d6b6826b9a4R56
Second, Content-Encoding gzip
will be supported next PR ! Thanks :)
Thank you for your response! It's good to hear that you are already working on this. There are some more functions not implemented yet, e.g. listing tables. But I guess you are also working on this. So I will close this issue for now and try it again later :-)
Hi @goccy,
We use the BigQuery JDBC driver (see documentation) in our project and would like to add integration tests using bigquery-emulator.
It's possible to specify a custom endpoint for the driver using the undocumented
RootURL
argument, e.g.:During our tests we found the following issues caused by the JDBC driver's behavior. We would like to contribute to your project and fix these issues if that's ok for you.
Path prefix
The driver always uses path prefix
/bigquery/v2
, e.g.POST /bigquery/v2/projects/test/queries
. This is not configurable. We propose to add a command line switch that allows overriding the default prefix""
, e.g.:Content-Encoding gzip
The driver sends payload with
Content-Encoding: gzip
. This is not configurable. We propose to add a middleware function toserver.go
that unzips the request payload if necessary. This would require adding an additional dependency, e.g. github.com/klauspost/compress/gzip.Job ID
When sending a SQL query, the JDBC driver sends request
POST /bigquery/v2/projects/test/queries
with the following payload:The emulator replies with this response:
This causes the following exception in the JDBC driver which is caused by the missing
jobId
injobReference
.The emulator uses
r.queryRequest.RequestId
as jobId (see handler.go) which isnil
in this case.We propose to generate a random ID in case
r.queryRequest.RequestId
isnil
.If these changes are OK for you, we would like create separate pull requests for each of these issues, or discuss how to solve them in a different way.
Thank you very much for your support!