Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have to extract data daily from big query. There is a new table created daily with the timestamp in it.
for example [dw-bigquery:45234.ga_table_20170626]
I am using a context variable which receives the date from a table in YYYY-mm-dd format.
Following is my query.
select * from
'[dw-bigquery:45234.ga_table_' +TalendDate.formatDate("yyyyMMdd", context.load_date)+ ']'
I get an error for invalid assignment operator.
Try this:
"select * from [dw-bigquery:45234.ga_table_" +TalendDate.formatDate("yyyyMMdd", context.load_date)+ "]"
because each string part must be enclosed between "" (don't know if you need ' and [] for big query).
I was still getting errors.
So I made it more simple
"select * from [dw-bigquery:45234.ga_table_" +context.load_date+ "]"
When I run it does not recognise context variable and the table looks like following
[dw-bigquery:45234.ga_table_]
Your context variable appears to be holding an empty String.
Can you show us the part of your job that retrieves the date and sets the context variable?
What was your solution using tjavarow?
First I select the date from my table using tPostgresqlInput and then assign it to context variable in t_javarow.
context.load_date=input.load_date
and later in tBigQueryInput I use the context variable as following for table name
[project-bigquery:123456.ga_sessions_" + context.load_date + "]