Created
November 15, 2019 13:57
-
-
Save juri96/39c711dcdf01333f710eefadaed50b10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE MODEL `GCP_PROJECT_NAME.DATASET_NAME.pollution_kmeans` OPTIONS(model_type='kmeans') AS | |
WITH dataset AS (SELECT pm25, | |
pm10, | |
so2, | |
co, | |
o3, | |
temp, | |
press, | |
dewp, | |
rain, | |
timestamp, | |
station | |
FROM `GCP_PROJECT_NAME.DATASET_NAME.measurements` | |
WHERE pm25 IS NOT NULL | |
AND pm10 IS NOT NULL | |
AND so2 IS NOT NULL | |
AND co IS NOT NULL | |
AND o3 IS NOT NULL | |
AND temp IS NOT NULL | |
AND press IS NOT NULL | |
AND dewp IS NOT NULL | |
AND rain IS NOT NULL | |
AND timestamp IS NOT NULL | |
AND station IS NOT NULL | |
) | |
SELECT pm25, | |
pm10, | |
so2, | |
co, | |
o3, | |
temp, | |
press, | |
dewp, | |
rain | |
FROM dataset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment