LoginSignup
0

More than 5 years have passed since last update.

BigQueryでテキストの分割

Posted at

Abstract

英語のテキストを扱う時のtipsです。
データとってからスクリプト書くよりもSQLでちょちょっと書いた方が楽なので好きです。
細かい色々が便利なので色々試してみたい。

Query

WITH split_words AS (
  SELECT 
    sentence, 
    SPLIT(sentence, " ") AS 'text_array', 
    ARRAY_LENGTH(SPLIT(sentence, " ") AS 'word_count'
  FROM 
    BQ_SCHEMA.BQ_TABLE

SELECT * FROM split_words;

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0