code: public static TableReference parseTableReference(String tableRefString) {
      // Logic mirrored from cloud/helix/clients/cli/bigquery_client.py.
      TableReference tableRef = new TableReference();
      int projectIdEnd = tableRefString.lastIndexOf(':');
      String datasetAndTableString = tableRefString;
      if (projectIdEnd != -1) {
        tableRef.setProjectId(tableRefString.substring(0, projectIdEnd));
  
        // Omit the ':' from the remaining datasetId.tableId substring.
        datasetAndTableString = tableRefString.substring(projectIdEnd + 1);
      }
  
      Preconditions.checkArgument(datasetAndTableString.matches(DATASET_AND_TABLE_REGEX),
          "Invalid datasetAndTableString '%s'; must match regex '%s'.",
          datasetAndTableString, DATASET_AND_TABLE_REGEX);
  
      String[] idParts = datasetAndTableString.split("\\.");
      tableRef.setDatasetId(idParts[0]);
      tableRef.setTableId(idParts[1]);
      return tableRef;
    }
docs: Parses a string into a TableReference; projectId may be omitted if the caller defines a
  "default" project; in such a case, getProjectId() of the returned TableReference will
  return null.
  
  @param tableRefString A string of the form [projectId]:[datasetId].[tableId].
  @return a TableReference with the parsed components.