Error interno de BigQuery UDF
Teníamos un UDF simple en BigQuery que de alguna manera arroja un error que sigue regresando
Query Failed
Error: An internal error occurred and the request could not be completed.
La consulta simplemente intentaba usar UDF para realizar un SHA256.
SELECT
input AS title,
input_sha256 AS title_sha256
FROM
SHA256(
SELECT
title AS input
FROM
[bigquery-public-data:hacker_news.stories]
GROUP BY
input
)
LIMIT
1000
El UDF en línea se pega a continuación. Sin embargo, no puedo publicar el UDF completo ya que StackOverflow se queja de demasiado código en la publicación. Se puede ver el UDF completoesta esencia.
function sha256(row, emit) {
emit(
{
input: row.input,
input_sha256: CryptoJS.SHA256(row.input).toString(CryptoJS.enc.Hex)
}
);
}
bigquery.defineFunction(
'SHA256', // Name of the function exported to SQL
['input'], // Names of input columns
[
{'name': 'input', 'type': 'string'},
{'name': 'input_sha256', 'type': 'string'}
],
sha256 // Reference to JavaScript UDF
);
No estoy seguro si ayuda, pero el ID de trabajo es
bigquery:bquijob_7fd3b51c_153c058dc7c
Parece que hay un problema similar en:
https://code.google.com/p/google-bigquery/issues/detail?id=478