def tokenize_table_name(full_table_name):
  """Tokenize a BigQuery table_name.

  Splits a table name in the format of 'PROJECT_ID.DATASET_NAME.TABLE_NAME' to
  a tuple of three strings, in that order.  PROJECT_ID may contain periods (for
  domain-scoped projects).

  Args:
    full_table_name: BigQuery table name, as PROJECT_ID.DATASET_NAME.TABLE_NAME.
  Returns:
    A tuple of project_id, dataset_name, and table_name.

  Raises:
    ValueError: If full_table_name cannot be parsed.
  """
  delimiter = '.'
  tokenized_table = full_table_name.split(delimiter)
  if not tokenized_table or len(tokenized_table) < 3:
    raise ValueError('Table name must be of the form '
                     'PROJECT_ID.DATASET_NAME.TABLE_NAME')
  # Handle project names with periods, e.g. domain.org:project_id.
  return (delimiter.join(tokenized_table[:-2]),
          tokenized_table[-2],
          tokenized_table[-1])