in zetasql-toolkit-bigquery/src/main/java/com/google/zetasql/toolkit/catalog/bigquery/BigQueryCatalog.java [435:453]
public void register(
ProcedureInfo procedureInfo, CreateMode createMode, CreateScope createScope) {
String fullName = String.join(".", procedureInfo.getNamePath());
this.validateCreateScope(
createScope, ImmutableList.of(CreateScope.CREATE_DEFAULT_SCOPE), fullName, "procedure");
this.validateNamePathForCreation(ImmutableList.of(fullName), createScope, "procedure");
List<String> catalogNamesForProcedure = buildCatalogNamesForResource(fullName);
try {
catalogNamesForProcedure.forEach(
catalogName ->
CatalogOperations.createProcedureInCatalog(
catalog, catalogName, procedureInfo, createMode));
} catch (CatalogResourceAlreadyExists alreadyExists) {
throw this.addCaseInsensitivityWarning(alreadyExists);
}
}