user3509528 :
I'm trying to create a local temp bigquery table in memory for testing purposes. I'm doing this in Java. I'm not finding a ton of info on this, it seems like BigQueryOptions.getDefaultInstance().getService() could do it, but the docs say that it looks for the GOOGLE_APPLICATION_CREDENTIALS environment variable for where to go.
Is there a way to do it locally?
Felipe Hoffa :
If you are working with Java and you are looking for a way to create unit tests with a mock of BigQuery, there's a GitHub project with a class that could do that for you:
- https://github.com/GoogleCloudPlatform/bigdata-interop
- https://github.com/GoogleCloudPlatform/bigdata-interop/blob/master/bigquery/src/test/java/com/google/cloud/hadoop/io/bigquery/BigQueryUtilsTest.java
BigQueryUtilsTest.java
relies on Mockito and it's under an Apache-2.0 license (if you need to modify it for your environment).