Skip to content

Commit

Permalink
Fix for #143: Let the driver determine the dataset location if non gi…
Browse files Browse the repository at this point in the history
…ven (#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.
  • Loading branch information
Tylorjg authored May 2, 2024
1 parent a18fff9 commit 6a7ffef
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/

public class BigqueryConnection extends JdbcConnection {
private String location = "US";
private S42Connection con;

public BigqueryConnection() {
Expand Down Expand Up @@ -87,10 +86,8 @@ public Connection getUnderlyingConnection() {
@Override
public void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException {
if (driverProperties.stringPropertyNames().contains("Location")) {
this.location = driverProperties.getProperty("Location");
} else {
this.location = getUrlParamValue(url, "Location", "US");
driverProperties.setProperty("Location", this.location);
String locationValue = getUrlParamValue(url, "Location");
driverProperties.setProperty("Location", locationValue);
}

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

0 comments on commit 6a7ffef

Please sign in to comment.