Table toPb() { Table tablePb = new Table(); if (getSchema() != null) { tablePb.setSchema(getSchema().toPb()); } tablePb.setType(getType().name()); return tablePb; }
@Override public Table apply(TableList.Tables tablePb) { return new Table() .setFriendlyName(tablePb.getFriendlyName()) .setId(tablePb.getId()) .setKind(tablePb.getKind()) .setTableReference(tablePb.getTableReference()) .setType(tablePb.getType()); } }));
@Override public Table create(Table table, Map<Option, ?> options) { try { // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); return bigquery .tables() .insert(reference.getProjectId(), reference.getDatasetId(), table) .setFields(Option.FIELDS.getString(options)) .execute(); } catch (IOException ex) { throw translate(ex); } }
@Override public Table patch(Table table, Map<Option, ?> options) { try { // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); return bigquery .tables() .patch(reference.getProjectId(), reference.getDatasetId(), reference.getTableId(), table) .setFields(Option.FIELDS.getString(options)) .execute(); } catch (IOException ex) { throw translate(ex); } }
Table toPb() { Table tablePb = new Table(); if (schema != null) { tablePb.setSchema(schema.toPb()); } tablePb.setType(type.name()); return tablePb; }
Table toPb() { Table tablePb = new Table(); if (schema != null) { tablePb.setSchema(schema.toPb()); } tablePb.setType(type.name()); return tablePb; }
public static TableInfo createViewInfo(com.google.api.services.bigquery.model.Table model) { String type = model.getType(); if (type == null) { model.setType(TableDefinition.Type.VIEW.name()); } TableId tableId = TableId.fromPb(model.getTableReference()); return TableInfo.of(tableId, ViewDefinition.of(new String(model.getView().getQuery().getBytes()))); }
public static TableInfo createTableInfo(com.google.api.services.bigquery.model.Table model) { String type = model.getType(); if (type == null) { model.setType(TableDefinition.Type.TABLE.name()); } TableId tableId = TableId.fromPb(model.getTableReference()); TableDefinition definition = tableDefinition(model); return TableInfo.newBuilder(tableId, definition).build(); }
Table toPb() { Table tablePb = new Table(); if (getSchema() != null) { tablePb.setSchema(getSchema().toPb()); } tablePb.setType(getType().name()); return tablePb; }
table.setView(currentStateViewGenerator.createViewDefinition(shape, dataSource)); if (table.getView() != null) { table.setType("VIEW"); tableVisitor.visit(dataSource, table); table.setType("EXTERNAL"); tableVisitor.visit(dataSource, table); } else { table.setType("TABLE"); tableVisitor.visit(dataSource, table);
@Override public Table create(Table table, Map<Option, ?> options) { try { // unset the type, as it is output only table.setType(null); return bigquery.tables() .insert(this.options.projectId(), table.getTableReference().getDatasetId(), table) .setFields(FIELDS.getString(options)) .execute(); } catch (IOException ex) { throw translate(ex); } }
@Override public Table create(Table table, Map<Option, ?> options) { try { // unset the type, as it is output only table.setType(null); return bigquery.tables() .insert(this.options.projectId(), table.getTableReference().getDatasetId(), table) .setFields(FIELDS.getString(options)) .execute(); } catch (IOException ex) { throw translate(ex); } }
@Override public Table apply(TableList.Tables tablePb) { return new Table() .setFriendlyName(tablePb.getFriendlyName()) .setId(tablePb.getId()) .setKind(tablePb.getKind()) .setTableReference(tablePb.getTableReference()) .setType(tablePb.getType()); } }));
@Override public Table create(Table table, Map<Option, ?> options) { try { // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); return bigquery .tables() .insert(reference.getProjectId(), reference.getDatasetId(), table) .setFields(Option.FIELDS.getString(options)) .execute(); } catch (IOException ex) { throw translate(ex); } }
@Override public Table apply(TableList.Tables tablePb) { return new Table() .setFriendlyName(tablePb.getFriendlyName()) .setId(tablePb.getId()) .setKind(tablePb.getKind()) .setTableReference(tablePb.getTableReference()) .setType(tablePb.getType()); } }));
@Override public Table apply(TableList.Tables tablePb) { return new Table() .setFriendlyName(tablePb.getFriendlyName()) .setId(tablePb.getId()) .setKind(tablePb.getKind()) .setTableReference(tablePb.getTableReference()) .setType(tablePb.getType()); } }));
@Override public Table patch(Table table, Map<Option, ?> options) { try { // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); return bigquery.tables() .patch(this.options.projectId(), reference.getDatasetId(), reference.getTableId(), table) .setFields(FIELDS.getString(options)) .execute(); } catch (IOException ex) { throw translate(ex); } }
@Override public Table patch(Table table, Map<Option, ?> options) { try { // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); return bigquery.tables() .patch(this.options.projectId(), reference.getDatasetId(), reference.getTableId(), table) .setFields(FIELDS.getString(options)) .execute(); } catch (IOException ex) { throw translate(ex); } }
@Override public Table patch(Table table, Map<Option, ?> options) { try { // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); return bigquery .tables() .patch(reference.getProjectId(), reference.getDatasetId(), reference.getTableId(), table) .setFields(Option.FIELDS.getString(options)) .execute(); } catch (IOException ex) { throw translate(ex); } }
private Table toTable(Shape shape, GoogleBigQueryTable dataSource) { Table table = new Table(); BigQueryTableReference ref = dataSource.getTableReference(); TableReference reference = new TableReference(); reference.setProjectId(ref.getProjectId()); reference.setDatasetId(ref.getDatasetId()); reference.setTableId(ref.getTableId()); table.setTableReference(reference); if (!(dataSource instanceof GoogleBigQueryView)){ TableSchema tableSchema = tableGenerator.toTableSchema(shape); table.setSchema(tableSchema); } ExternalDataConfiguration external = dataSource.getExternalDataConfiguration(); if (external != null) { table.setExternalDataConfiguration(external); table.setType("EXTERNAL"); } return table; }