Skip to content

Commit 6a7ffef

Browse files
authored
Fix for #143: Let the driver determine the dataset location if non given (#301)
* Removed the else statement from the open function. Based on the Google Simba driver documentation, the location is automatically handled based on where the dataset exists. * Removed the location variable that wasn't used and refactored the if condition for the open function.
1 parent a18fff9 commit 6a7ffef

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/java/liquibase/ext/bigquery/database/BigqueryConnection.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*/
2121

2222
public class BigqueryConnection extends JdbcConnection {
23-
private String location = "US";
2423
private S42Connection con;
2524

2625
public BigqueryConnection() {
@@ -87,10 +86,8 @@ public Connection getUnderlyingConnection() {
8786
@Override
8887
public void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException {
8988
if (driverProperties.stringPropertyNames().contains("Location")) {
90-
this.location = driverProperties.getProperty("Location");
91-
} else {
92-
this.location = getUrlParamValue(url, "Location", "US");
93-
driverProperties.setProperty("Location", this.location);
89+
String locationValue = getUrlParamValue(url, "Location");
90+
driverProperties.setProperty("Location", locationValue);
9491
}
9592

9693
Scope.getCurrentScope().getLog(this.getClass()).fine(String.format("Opening connection to %s driverProperties=%s", url, driverProperties));

0 commit comments

Comments
 (0)