{"record":{"id":"b844e6a034f39e36","repo":"apache/beam","slug":"unsupported-format-for-bigquery-table-path-linkedresource","errorCode":null,"errorMessage":"Unsupported format for BigQuery table path: '{linkedResource}'","messagePattern":"Unsupported format for BigQuery table path: '(.+?)'","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/BigQueryTableFactory.java","lineNumber":62,"sourceCode":"    if (!URI.create(entry.getLinkedResource()).getAuthority().equalsIgnoreCase(BIGQUERY_API)) {\n      return Optional.empty();\n    }\n\n    return Optional.of(\n        Table.builder()\n            .location(getLocation(entry))\n            .properties(TableUtils.emptyProperties().put(\"truncateTimestamps\", truncateTimestamps))\n            .type(\"bigquery\")\n            .comment(\"\"));\n  }\n\n  private static String getLocation(Entry entry) {\n    URI entryName = URI.create(entry.getLinkedResource());\n    String bqPath = entryName.getPath();\n\n    Matcher bqPathMatcher = BQ_PATH_PATTERN.matcher(bqPath);\n    if (!bqPathMatcher.matches()) {\n      throw new IllegalArgumentException(\n          \"Unsupported format for BigQuery table path: '\" + entry.getLinkedResource() + \"'\");\n    }\n\n    String project = bqPathMatcher.group(\"PROJECT\");\n    String dataset = bqPathMatcher.group(\"DATASET\");\n    String table = bqPathMatcher.group(\"TABLE\");\n\n    return String.format(\"%s:%s.%s\", project, dataset, table);\n  }\n}\n","sourceCodeStart":44,"sourceCodeEnd":73,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/BigQueryTableFactory.java#L44-L73","documentation":"BigQueryTableFactory resolves a DataCatalog Entry's linked resource into project/dataset/table coordinates. The linked resource URI path must match the expected BigQuery path pattern (projects/{p}/datasets/{d}/tables/{t}); otherwise an IllegalArgumentException is thrown because the table location cannot be parsed.","triggerScenarios":"Registering or looking up a DataCatalog entry whose linkedResource is not a BigQuery table path — e.g. a BigQuery dataset, a non-BigQuery resource type (GCS, Pub/Sub), a partitioned table suffix like @YYYYMMDD, or a truncated/malformed resource name.","commonSituations":"Cataloging views or datasets instead of tables, entries pointing at other GCP services, using legacy-style or aliased resource names, or region-tagged paths like projects/p/locations/eu/... that the pattern does not accept.","solutions":["Verify the entry's linkedResource matches projects/<project>/datasets/<dataset>/tables/<table> and point the entry at a real BigQuery table.","If the entry is a view or dataset, materialize/point to an actual table resource in Data Catalog.","Strip any partition decorators (@date) or extra path segments from the resource name before lookup."],"exampleFix":"// before (entry linkedResource)\n// projects/my-proj/datasets/my_ds  (dataset, not a table)\n\n// after\n// projects/my-proj/datasets/my_ds/tables/my_table","handlingStrategy":"validation","validationCode":"String linked = entry.getLinkedResource();\nURI uri = URI.create(linked);\nboolean ok = Pattern.matches(\"^/projects/[^/]+/datasets/[^/]+/tables/[^/]+$\", uri.getPath());\nif (!ok) throw new IllegalArgumentException(\"Not a BigQuery table path: \" + linked);","typeGuard":null,"tryCatchPattern":"try {\n  Table t = provider.getTable(name);\n} catch (IllegalArgumentException e) {\n  // path did not match BigQuery table pattern; inspect linkedResource\n}","preventionTips":["Only register actual BigQuery tables (not datasets/views) with Beam SQL via DataCatalog","Strip partition decorators (@YYYYMMDD) from resource names","Print entry.getLinkedResource() and verify the projects/.../datasets/.../tables/... shape"],"tags":["apache-beam","bigquery","datacatalog","java"],"backgroundTag":"invalid-url-format","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}