¿Las vistas laterales están disponibles en BigQuery?
Frecuentes
Visto 2,572 veces
1
I want to do something like this using BigQuery. Input Table
|Col1 | Col2 |
|------|------|
|1 | A,B,C|
Tabla de salida
|Col1 | Col2 |
|------|------|
|1 | A |
|1 | B |
|1 | C |
Is there some way of doing above operation in BigQuery
. The same functionality can be achieved in Hive using Lateral Views .
2 Respuestas
2
Creo que esto debería funcionar:
select
col1,
split(col2) as col2_split
from table;
Respondido el 04 de Septiembre de 15 a las 21:09
0
There's no split() function in BigQuery, that would be useful in this case to split by commas. But you can use regular expressions to get the same result, with REGEXP_REPLACE.
Comprueba la respuesta a esta pregunta:
encontrar todas las frases de dos palabras que aparecen en más de una fila en un conjunto de datos
contestado el 23 de mayo de 17 a las 13:05
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas google-bigquery or haz tu propia pregunta.
was there some formatting lost while asking the question? the example lines look very flat - Felipe Hoffa
I have reformatted ... Please help - user2553672
So the first table has two columns, and you want to split a comma separated value into 3 rows? - Felipe Hoffa
Yes exactly that's what I want.. Split comma separated value into rows. Please help me on the same. - user2553672
good news, BigQuery now supports SPLIT() - Felipe Hoffa