Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
BigRQuery在导入时删除数据_R_Bigrquery - Fatal编程技术网

BigRQuery在导入时删除数据

BigRQuery在导入时删除数据,r,bigrquery,R,Bigrquery,我有一个大型数据库,其中有几个表正试图导入和连接: con <- DBI::dbConnect( bigrquery::bigquery(), project = "project", dataset = "dataset" ) table1 <- dplyr::tbl(con, "table1") table2 <- dplyr::tbl(con, "table2") df <

我有一个大型数据库,其中有几个表正试图导入和连接:

con <- DBI::dbConnect(
  bigrquery::bigquery(),
  project = "project",
  dataset = "dataset"
)

table1 <- dplyr::tbl(con, "table1")
table2 <- dplyr::tbl(con, "table2")

df <- puf %>% dplyr::filter(code == "48140") %>% dplyr::left_join(., table2, by = c("id", "year")) %>% dplyr::collect()
它返回相同数量的行(20515),但
min(id)
28309
。所以我知道数据正在改变。我知道数据集中没有7656条相同的记录

       id    year sex    race ethnicity       codex code     hourwks  inout  train   age    yr       syr     nextyr     colorof    goingto   boolean1       boolean2   int1   int2   height  weight boolean3  boolean4   
    <int>   <dbl> <lgl> <int> <lgl>            <chr>   <chr>   <dbl> <lgl>  <int> <int> <date>     <date>     <date>     <lgl>         <int>    <int>          <int>  <int>    <int>  <int>  <int> <lgl>    <lgl>  
 1      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
 2      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
 3      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
 4      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
 5      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
 6      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
 7      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
 8      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
 9      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
10      0       0 FALSE     0 FALSE            ""      ""          0 FALSE      0     0 1970-01-01 1970-01-01 1970-01-01 FALSE             0        0              0      0        0      0      0 FALSE    FALSE  
SELECT min(id),
FROM table1
LEFT JOIN table2 using (id, year)
WHERE code in ("48140")