in zetasql-toolkit-bigquery/src/main/java/com/google/zetasql/toolkit/catalog/bigquery/BigQueryCatalog.java [400:421]
public void register(TVFInfo tvfInfo, CreateMode createMode, CreateScope createScope) {
String fullName = String.join(".", tvfInfo.getNamePath());
this.validateCreateScope(
createScope, ImmutableList.of(CreateScope.CREATE_DEFAULT_SCOPE), fullName, "TVF");
this.validateNamePathForCreation(tvfInfo.getNamePath(), createScope, "TVF");
TVFInfo resolvedTvfInfo =
FunctionResultTypeResolver.resolveTVFOutputSchema(
tvfInfo, BigQueryLanguageOptions.get(), this.catalog);
List<String> catalogNamesForFunction = buildCatalogNamesForResource(fullName);
try {
catalogNamesForFunction.forEach(
catalogName ->
CatalogOperations.createTVFInCatalog(
catalog, catalogName, resolvedTvfInfo, createMode));
} catch (CatalogResourceAlreadyExists alreadyExists) {
throw this.addCaseInsensitivityWarning(alreadyExists);
}
}