Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,23 @@ public Identifier[] listTables(String[] namespace) throws NoSuchNamespaceExcepti
@Override
public Table loadTable(Identifier identifier) throws NoSuchTableException {
logger.debug("loading table [{}])", format(identifier));
TableId tableId = toTableId(identifier);
Map config = tableId.getProject() != null ?
ImmutableMap.of(
"project", tableId.getProject(),
"dataset", tableId.getDataset(),
"table", tableId.getTable()) :
ImmutableMap.of(
"dataset", tableId.getDataset(),
"table", tableId.getTable());
try {
return identifierToTableCache.get(
identifier.toString(),
() ->
// TODO: reuse injector
Spark3Util.createBigQueryTableInstance(
Spark35BigQueryTable::new,
null,
ImmutableMap.of(
"dataset", identifier.namespace()[0], "table", identifier.name())));
null, config));
} catch (ExecutionException e) {
throw new BigQueryConnectorException("Problem loaing table " + identifier, e);
}
Expand Down