Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: update listPartitions() to support tables from other projects (#974
)

* fix: update listPartitions() to support tables from other projects

* code format

Co-authored-by: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com>

Co-authored-by: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com>
  • Loading branch information
davidrabinowitz and yoshi-code-bot committed Nov 25, 2020
1 parent 9028ee4 commit 1739d57
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -848,8 +848,12 @@ public Page<Routine> listRoutines(DatasetId datasetId, RoutineListOption... opti
@Override
public List<String> listPartitions(TableId tableId) {
List<String> partitions = new ArrayList<String>();
Table metaTable =
getTable(TableId.of(tableId.getDataset(), tableId.getTable() + "$__PARTITIONS_SUMMARY__"));
String partitionsTable = tableId.getTable() + "$__PARTITIONS_SUMMARY__";
TableId metaTableId =
tableId.getProject() == null
? TableId.of(tableId.getDataset(), partitionsTable)
: TableId.of(tableId.getProject(), tableId.getDataset(), partitionsTable);
Table metaTable = getTable(metaTableId);
Schema metaSchema = metaTable.getDefinition().getSchema();
String partition_id = null;
for (Field field : metaSchema.getFields()) {
Expand Down

0 comments on commit 1739d57

Please sign in to comment.