Comments (8)
Shouldn't that be tabla3 %>% compute(I("churn.tabla3"), temporary = FALSE)
? If that doesn't work, I'd say it's a bug.
from bigrquery.
Ups.. You're right. The I
is neccesary
tabla3 %>% compute(I("churn.test"), temporary = FALSE)
load_tabla3 <- sc %>% tbl(I("churn.test"))
load_tabla3 %>% head(6)
# Source: SQL [6 x 41]
# Database: BigQueryConnection
customerID gender_x SeniorCitizen_x Partner_x Dependents_x tenure_x
<chr> <chr> <int> <lgl> <lgl> <int>
1 8883-GRDWQ Male 1 FALSE FALSE 20
2 1088-CNNKB Male 0 TRUE FALSE 63
3 2282-YGNOR Female 0 FALSE FALSE 29
4 2361-FJWNO Male 0 FALSE FALSE 40
5 3605-JISKB Male 1 TRUE FALSE 55
6 4003-OCTMP Female 0 TRUE FALSE 31
Thanks a lot. In next months I'll use this package in my job..
from bigrquery.
Maybe sometthing like that.
write_table_bq <- function(table_to_write, project,dataset, table_new){
query <- stringr::str_glue("CREATE TABLE `{project}.{dataset}.{table_new}` AS {dbplyr::sql_render(table_to_write) %>% as.character()}")
bigrquery::bq_project_query(project, query)
}
from bigrquery.
You should be able to use compute(tbl, "name", temporary = FALSE)
.
from bigrquery.
Thanks @hadley by answer me and for your bigrquery package. bigrquery will help me in my job the next months.
compute(tbl, "name", temporary = FALSE)
not work , (using name like myproject.dataset.nametable, neither with dataset.nametable or only nametable.
For write tables I use the function in my previous coment. write_table_bq
And this morning I'm working in a simple way to write table in temporary dataset and then bring the refereence again to use in bigrquery and use dplyr syntax.
What do you think about this idea?
get_bq_table <- function(table, project,dataset){
query <- stringr::str_glue("{dbplyr::sql_render(table) %>% as.character()}")
tb_bq <- bigrquery::bq_project_query(project, query)
}
get_lazy_from_bq <- function(table, con){
meta <- bigrquery::bq_table_meta(table)
tb_name <- paste0(meta$tableReference$datasetId, ".", meta$tableReference$tableId)
con %>% tbl(I(tb_name))
}
bq_compute <- function(table) {
atrib_con <- attributes(table$src$con)
project <- atrib_con$project
dataset <- atrib_con$dataset
con <- table$src
temp_table <- get_bq_table(table, project, dataset)
ref_table <- get_lazy_from_bq(temp_table, con)
}
And I can do things like that
tabla4 <- tabla1 %>%
inner_join(tabla2, by = "customerID") %>%
bq_compute()
from bigrquery.
If compute()
doesn't work, it should be made to work, because that's the official dbplyr syntax.
from bigrquery.
Uhm, I'm just update my packages, and compute works perfectly. Thanks @hadley . I close the issue with this comment
from bigrquery.
The problem was if I have a connection without dataset .
sc <- src_bigquery("my_project", dataset = NULL, max_pages = 10)
tabla1 <- sc %>% tbl(I("churn.tabla1"))
tabla2 <- sc %>% tbl(I("churn.tabla2"))
# This works
tabla3 <- tabla1 %>%
inner_join(tabla2, by = "customerID") %>%
compute()
# This not works.
tabla3 %>%
compute("churn.tabla3.", temporary = FALSE)
But if I use src_bigquery with dataset, all works fine
sc <- src_bigquery("my_project", dataset = "churn", max_pages = 10)
from bigrquery.
Related Issues (20)
- Update for dbplyr 2.4.0 quoting semantics
- Remove unprefixed deprecated functions
- Switch `expect_error()` to `expect_snapshot()`
- Use sessions HOT 2
- Switch to defer
- Add gzip to user agent? HOT 1
- update scheduled query HOT 8
- Seconds decimal dropped in new parsing HOT 4
- tbl() breaking when used with dbConnect - again? HOT 2
- Release bigrquery 1.5.0
- compute() function in dplyr is broken HOT 2
- Release bigrquery 1.5.1
- compute() permission denied even for temporary tables. HOT 2
- `dbplyr::table_path_components()` fails to parse components as table name is enclosed with backticks HOT 5
- Improve bq_perform_upload to upload as PARQUET file HOT 2
- bigrquery::bq_auth() Doesn't work, Warning message: Unable to refresh token: invalid_grant Account has been deleted HOT 3
- tbl(con, sql("string query")) errors if the query contains 3 or more periods HOT 1
- Exporting data to Google Cloud Storage in Parquet format available but undocumented HOT 3
- Unexpected data type change when downloading zero row data frame HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigrquery.