Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. CREATE TEMP FUNCTION extractFunctionsWithComments(str STRING)
  2. RETURNS ARRAY<STRING>
  3. LANGUAGE JS AS """
  4. return extractFunctions(str);
  5. """
  6. OPTIONS (library="gs://github-data/functionExtractor.js")
  7.  
  8. SELECT JSON_EXTRACT_SCALAR(func, "$.name") AS name,
  9. JSON_EXTRACT_SCALAR(func, "$.params") AS params,
  10. JSON_EXTRACT_SCALAR(func, "$.comments") AS comments,
  11. JSON_EXTRACT_SCALAR(func, "$.blockStart") AS blockStart,
  12. JSON_EXTRACT_SCALAR(func, "$.block") AS block,
  13. contents.path,
  14. FROM 'github_js.github_contents' as contents
  15. CROSS JOIN UNNEST(extractFunctionsWithComments(contents.content)) AS FUNC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement