Skip to content

Conversation

@alixhami
Copy link
Contributor

Adds the following samples:

  • Load samples for Orc & Parquet
  • Load autodetect samples for CSV and JSON
  • Load truncate samples for CSV, JSON, Orc, and Parquet

@alixhami alixhami requested a review from bshaffer September 19, 2018 20:56
Copy link
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than fixing the usage text, this looks great. You could even do something like this for the usage:

return printf("Usage: php snippets/%s PROJECT_ID DATASET_ID\n", __FILE__);

Other thoughts, if you want to get rid of the snippets directory and move them into the main folder, be my guest.

// Include Google Cloud dependendencies using Composer
require_once __DIR__ . '/../vendor/autoload.php';
if (count($argv) != 3) {
return print("Usage: php snippets/import_from_storage.php PROJECT_ID DATASET_ID\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be import_from_storage_orc.php

// Include Google Cloud dependendencies using Composer
require_once __DIR__ . '/../vendor/autoload.php';
if (count($argv) != 4) {
return print("Usage: php snippets/import_from_storage.php PROJECT_ID DATASET_ID TABLE_ID\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be import_from_storage_truncate.php

// Include Google Cloud dependendencies using Composer
require_once __DIR__ . '/../vendor/autoload.php';
if (count($argv) != 3) {
return print("Usage: php snippets/import_from_storage.php PROJECT_ID DATASET_ID\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be import_from_storage_autodetect.php

// Include Google Cloud dependendencies using Composer
require_once __DIR__ . '/../vendor/autoload.php';
if (count($argv) != 4) {
return print("Usage: php snippets/import_from_storage.php PROJECT_ID DATASET_ID TABLE_ID\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be import_from_storage_csv_truncate.php

// Include Google Cloud dependendencies using Composer
require_once __DIR__ . '/../vendor/autoload.php';
if (count($argv) != 3) {
return print("Usage: php snippets/import_from_storage.php PROJECT_ID DATASET_ID\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be import_from_storage_csv_autodetect.php

// Include Google Cloud dependendencies using Composer
require_once __DIR__ . '/../vendor/autoload.php';
if (count($argv) != 4) {
return print("Usage: php snippets/import_from_storage.php PROJECT_ID DATASET_ID TABLE_ID\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be import_from_storage_orc_truncate.php

// Include Google Cloud dependendencies using Composer
require_once __DIR__ . '/../vendor/autoload.php';
if (count($argv) != 3) {
return print("Usage: php snippets/import_from_storage.php PROJECT_ID DATASET_ID\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be import_from_storage_parquet.php

// Include Google Cloud dependendencies using Composer
require_once __DIR__ . '/../vendor/autoload.php';
if (count($argv) != 4) {
return print("Usage: php snippets/import_from_storage.php PROJECT_ID DATASET_ID TABLE_ID\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be import_from_storage_parquet_truncate.php

@bshaffer bshaffer merged commit 1d884c1 into master Sep 20, 2018
@bshaffer bshaffer deleted the bq-load-samples branch September 20, 2018 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants