I am trying to efficiently query from the last table in a dataset that consists of form tables project_id:dataset:dataset_20160101, project_id:dataset:dataset_20160102etc.
project_id:dataset:dataset_20160101
project_id:dataset:dataset_20160102
This query seems to be the recommended solution:
SELECT * FROM `project_id.dataset.*` WHERE _TABLE_SUFFIX=(SELECT MAX(table_id) FROM `project_id.dataset.__TABLES_SUMMARY__`)
However, this query forces me to access all the tables in the data set, not just the last one. Why is this?
, , WHERE , , _TABLE_SUFFIX = 'dataset_20160102'. , WHERE -Uery, , . , . - .
. , , . ETA.
, , , (1) MAX (table_id) (2) :
SELECT *, DATE max_table_id AS _LATEST_DATE, PARSE_DATE('%E4Y%m%d', _TABLE_SUFFIX) AS _DATA_DATE FROM `project_id.dataset.*`
, , _DATA_DATE = _LATEST_DATE. _LATEST_DATE , . , .
Source: https://habr.com/ru/post/1679661/More articles:How to create a text file and write it in vbscript - vbscriptTraining and testing images with different resolutions in Keras - pythonHow to call from websocket API website? - websocketБольше не может импортировать BrowserAnimationsModule в Angular 4.2.3 - node.jsVS.2017 cannot add a project to TFS Source Control - tfsSaving Left Shifted Bits (SHL) - performanceAre there any fundamental incompatibilities when using the CMD script in the console using PowerShell? - windowsAndroid library does not work with Java 8 - javaFree verification with Swagger in Core Asp.net - asp.net-coreUWP application will not start on the second machine - c #All Articles