-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce BigQuery Regionalization Support #971
Conversation
/cc @jjolma If you would like to take a look as well :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple little doc things
* @type string $location If provided, determines the default geographic | ||
* location used when creating datasets and managing jobs. Please | ||
* note: This is only required for jobs started outside of the US | ||
* and EU regions. Also, if location metadata has already been |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
BigQuery/src/BigQueryClient.php
Outdated
@@ -537,6 +577,10 @@ public function createDataset($id, array $options = []) | |||
unset($options['metadata']); | |||
} | |||
|
|||
if (!isset($options['location']) && $this->location) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
class RegionalizationTest extends BigQueryTestCase | ||
{ | ||
const REGION_ASIA = 'asia-northeast1'; | ||
const REGION_US = 'US'; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
self::$datasetAsia->id(), | ||
self::$tableAsia->id() | ||
) | ||
)->location($location); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
$caught = false; | ||
$copyTable = self::$dataset->table(self::TESTING_PREFIX); | ||
$copy = self::$tableAsia->copy($copyTable) | ||
->location($location); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
{ | ||
$caught = false; | ||
$extract = self::$tableAsia->extract( | ||
self::$bucket->object(self::TESTING_PREFIX) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
file_get_contents(__DIR__ . '/data/table-data.json') | ||
) | ||
->sourceFormat('NEWLINE_DELIMITED_JSON') | ||
->location($location); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
]; | ||
} | ||
|
||
private function assertExceptionShouldBeThrown($location, $caught) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@tswast Thanks for the solid feedback. PTAL and let me know what you think of the updates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much clearer. Thanks!
LGTM. Thanks! |
Source-Link: googleapis/googleapis@7d0c6be Source-Link: googleapis/googleapis-gen@2ddc476 Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiMmRkYzQ3NmQ0Y2NlNmYwN2I1MWNjNjk2ZmZjM2UwYzRjNzYxYmIxOCJ9
Source-Link: googleapis/googleapis@7d0c6be Source-Link: googleapis/googleapis-gen@2ddc476 Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiMmRkYzQ3NmQ0Y2NlNmYwN2I1MWNjNjk2ZmZjM2UwYzRjNzYxYmIxOCJ9
This change set introduces the ability to supply a location when managing jobs.
Some usage examples: