Skip to content

Commit

Permalink
fixing columns netcdf issue #43
Browse files Browse the repository at this point in the history
  • Loading branch information
bastienird committed Aug 25, 2023
1 parent 5940f1a commit 735b970
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sardara_functions/getSQLSardaraQueries.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ getSQLSardaraQueries <- function (con, dataset_metadata)
columns_netcdf <- strsplit(paste(db_dimensions_parameters$sql_select_netcdf_from_fact_table[which(db_dimensions_parameters$dimension %in%
dataset_available_dimensions)], collapse = ""),
split = ",")[[1]]
columns_netcdf[] <- unlist(lapply(columns_netcdf, trimws))
columns_netcdf <- subset(columns_netcdf, columns_netcdf != "")

columns_csv_wms_wfs_with_labels <- c(columns_csv_wms_wfs,
strsplit(paste(db_dimensions_parameters$sql_select_labels_csv_wms_wfs_from_fact_table[which(db_dimensions_parameters$dimension %in%
dataset_available_dimensions)], collapse = ""),
Expand All @@ -200,6 +203,7 @@ getSQLSardaraQueries <- function (con, dataset_metadata)
geo_identifier_column <- dbGetQuery(con, paste0("select distinct(tablesource_area) from ",
dataset_metadata$database_table_name, " tab join area.area tab_link on tab_link.id_area=tab.id_area where tab.id_area<>0 and tab.id_metadata=",
dataset_metadata$id_metadata))$tablesource_area

if (tolower(static_metadata_table_view_name) %in% tables_views_materializedviews) {
column_names_and_types_dataset <- dbGetQuery(con,
paste0("SELECT a.attname,pg_catalog.format_type(a.atttypid, a.atttypmod)\n FROM pg_attribute a\n JOIN pg_class t on a.attrelid = t.oid\n JOIN pg_namespace s on t.relnamespace = s.oid\n WHERE a.attnum > 0 \n AND NOT a.attisdropped\n AND s.nspname||'.'||t.relname = '",
Expand Down

0 comments on commit 735b970

Please sign in to comment.