From 938cfe78310a69007bd78dbcd0246f3adf03b905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Mon, 30 May 2022 07:48:36 +0200 Subject: [PATCH] Work around permission issues --- R/learn.R | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/R/learn.R b/R/learn.R index 79cdf87b44..4f4744e862 100644 --- a/R/learn.R +++ b/R/learn.R @@ -107,7 +107,10 @@ dm_learn_from_db_meta <- function(con, catalog = NULL, schema = NULL, name_forma left_join(columns, select = c(column_name, dm_name, table_catalog, table_schema, table_name)) %>% dm_update_zoomed() %>% dm_zoom_to(constraint_column_usage) %>% - left_join(columns, select = c(column_name, dm_name, table_catalog, table_schema, table_name)) %>% + + # inner_join(): Matching column sometimes not found on Postgres + inner_join(columns, select = c(column_name, dm_name, table_catalog, table_schema, table_name)) %>% + dm_update_zoomed() %>% dm_select_tbl(-columns) %>% dm_rename(constraint_column_usage, constraint_column_usage.table_catalog = table_catalog) %>% @@ -153,10 +156,6 @@ dm_learn_from_db_meta <- function(con, catalog = NULL, schema = NULL, name_forma ))) %>% ungroup() %>% select(-(1:3)) %>% - - # FIXME: Where does this come from? - filter(!is.na(ref_table)) %>% - group_by(table = ref_table) %>% summarize(fks = list(bind_rows(fks))) %>% ungroup()