Skip to content
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

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

Merged
merged 2 commits into from Nov 25, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -848,8 +848,11 @@ 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);
davidrabinowitz marked this conversation as resolved.
Show resolved Hide resolved
Table metaTable = getTable(metaTableId);
Schema metaSchema = metaTable.getDefinition().getSchema();
String partition_id = null;
for (Field field : metaSchema.getFields()) {
Expand Down