{"action":"created","issue":{"url":"https://api.github.com/repos/NREL/rplexos/issues/29","labels_url":"https://api.github.com/repos/NREL/rplexos/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/NREL/rplexos/issues/29/comments","events_url":"https://api.github.com/repos/NREL/rplexos/issues/29/events","html_url":"https://github.com/NREL/rplexos/issues/29","id":64215835,"number":29,"title":"Error in query interval","user":{"login":"takje","id":6696142,"avatar_url":"https://avatars.githubusercontent.com/u/6696142?v=3","gravatar_id":"","url":"https://api.github.com/users/takje","html_url":"https://github.com/takje","followers_url":"https://api.github.com/users/takje/followers","following_url":"https://api.github.com/users/takje/following{/other_user}","gists_url":"https://api.github.com/users/takje/gists{/gist_id}","starred_url":"https://api.github.com/users/takje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takje/subscriptions","organizations_url":"https://api.github.com/users/takje/orgs","repos_url":"https://api.github.com/users/takje/repos","events_url":"https://api.github.com/users/takje/events{/privacy}","received_events_url":"https://api.github.com/users/takje/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NREL/rplexos/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"eibanez","id":438494,"avatar_url":"https://avatars.githubusercontent.com/u/438494?v=3","gravatar_id":"","url":"https://api.github.com/users/eibanez","html_url":"https://github.com/eibanez","followers_url":"https://api.github.com/users/eibanez/followers","following_url":"https://api.github.com/users/eibanez/following{/other_user}","gists_url":"https://api.github.com/users/eibanez/gists{/gist_id}","starred_url":"https://api.github.com/users/eibanez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eibanez/subscriptions","organizations_url":"https://api.github.com/users/eibanez/orgs","repos_url":"https://api.github.com/users/eibanez/repos","events_url":"https://api.github.com/users/eibanez/events{/privacy}","received_events_url":"https://api.github.com/users/eibanez/received_events","type":"User","site_admin":false},"milestone":null,"comments":19,"created_at":"2015-03-25T08:43:28Z","updated_at":"2015-04-22T07:39:34Z","closed_at":null,"body":"Hi,\r\n\r\nI tried version 0.13 and everything looks great. I really love the new functions. However, I just ran the command:\r\n```\r\nQueryProd <- query_interval(db,\r\n                            \"Generator\",\r\n                            \"Generation\",\r\n                            phase=Phase_id,\r\n                            c(\"category\",\"region\",\"sample\"))\r\n```\r\nand got the error\r\n```\r\nError in vecseq(f__, len__, if (allow.cartesian || notjoin) NULL else as.integer(max(nrow(x),  : \r\n  Join results in 8185288 rows; more than 4497408 = max(nrow(x),nrow(i)). Check for duplicate key\r\nvalues in i, each of which join to the same group in x over and over again. If that's ok, try including\r\n`j` and dropping `by` (by-without-by) so that j runs for each group to avoid the large allocation. If \r\nyou are sure you wish to proceed, rerun with allow.cartesian=TRUE. Otherwise, please search for\r\nthis error message in the FAQ, Wiki, Stack Overflow and datatable-help for advice.\r\n```\r\nThis is what the traceback looks like:\r\n```\r\n20 vecseq(f__, len__, if (allow.cartesian || notjoin) NULL else as.integer(max(nrow(x), \r\n    nrow(i)))) \r\n19 `[.data.table`(out2, cj2, roll = TRUE) \r\n18 out2[cj2, roll = TRUE] \r\n17 query_master_each(., time, col, prop, columns, time.range, filter, \r\n    phase) \r\n16 eval(expr, envir, enclos) \r\n15 eval(args[[j]]$expr, envir = env) \r\n14 do_.grouped_df(.data, .dots = lazyeval::lazy_dots(...)) \r\n13 do_(.data, .dots = lazyeval::lazy_dots(...)) \r\n12 do(., query_master_each(., time, col, prop, columns, time.range, \r\n    filter, phase)) \r\n11 function_list[[k]](value) \r\n10 withVisible(function_list[[k]](value)) \r\n9 freduce(value, `_function_list`) \r\n8 `_fseq`(`_lhs`) \r\n7 eval(expr, envir, enclos) \r\n6 eval(quote(`_fseq`(`_lhs`)), env, env) \r\n5 withVisible(eval(quote(`_fseq`(`_lhs`)), env, env)) \r\n4 db2 %>% do(query_master_each(., time, col, prop, columns, time.range, \r\n    filter, phase)) \r\n3 query_master(db, \"interval\", ...) \r\n2 query_interval(db, \"Generator\", \"Generation\", phase = Phase_id, \r\n    c(\"category\", \"region\", \"sample\")) at Create.R#198\r\n1 CreateCSVs(folder)\r\n```\r\nThere is no join command in my code, so I assume that it happens somewhere in the function. Any idea how I can fix this?"},"comment":{"url":"https://api.github.com/repos/NREL/rplexos/issues/comments/95062526","html_url":"https://github.com/NREL/rplexos/issues/29#issuecomment-95062526","issue_url":"https://api.github.com/repos/NREL/rplexos/issues/29","id":95062526,"user":{"login":"takje","id":6696142,"avatar_url":"https://avatars.githubusercontent.com/u/6696142?v=3","gravatar_id":"","url":"https://api.github.com/users/takje","html_url":"https://github.com/takje","followers_url":"https://api.github.com/users/takje/followers","following_url":"https://api.github.com/users/takje/following{/other_user}","gists_url":"https://api.github.com/users/takje/gists{/gist_id}","starred_url":"https://api.github.com/users/takje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takje/subscriptions","organizations_url":"https://api.github.com/users/takje/orgs","repos_url":"https://api.github.com/users/takje/repos","events_url":"https://api.github.com/users/takje/events{/privacy}","received_events_url":"https://api.github.com/users/takje/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T07:39:34Z","updated_at":"2015-04-22T07:39:34Z","body":"@eibanez: This is the code I ran:\r\n\r\n```\r\nanonymize <- function(data){\r\n  if('name' %in% names(data)){\r\n    data <- data %>%\r\n      mutate(name = name %>% factor %>% as.numeric)\r\n  }\r\n  if('region' %in% names(data)){\r\n    data <- data %>%\r\n      mutate(region = region %>% factor %>% as.numeric)\r\n  }\r\n  data\r\n}\r\na <- query_sql(db, \"SELECT * FROM key WHERE key == 82747\") %>% anonymize()\r\nb <- query_sql(db, \"SELECT * FROM data_interval_Generator_Generation WHERE key == 82747\") %>% anonymize()\r\nc <- query_sql(db, \"SELECT * FROM Generator_Generation WHERE key == 82747\") %>% anonymize()\r\nsave(a,b,c,file='QueryData.RData')\r\n```\r\n\r\nI sent you the files again via wetransfer."}}