{"record":{"id":"20719007382a413a","repo":"apache/iceberg","slug":"uri-convert-to-fileuri-error-uri-is-207190","errorCode":null,"errorMessage":"Uri convert to FileURI error! Uri is {}.","messagePattern":"Uri convert to FileURI error! Uri is (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/FileUriKeySelector.java","lineNumber":56,"sourceCode":"\n  static final String INVALID_URI = \"__INVALID_URI__\";\n\n  private final Map<String, String> equalSchemes;\n  private final Map<String, String> equalAuthorities;\n\n  public FileUriKeySelector(\n      Map<String, String> equalSchemes, Map<String, String> equalAuthorities) {\n    this.equalSchemes = equalSchemes;\n    this.equalAuthorities = equalAuthorities;\n  }\n\n  @Override\n  public String getKey(String value) throws Exception {\n    try {\n      FileURI fileUri = new FileURI(new Path(value).toUri(), equalSchemes, equalAuthorities);\n      return fileUri.getPath();\n    } catch (Exception e) {\n      LOG.warn(\"Uri convert to FileURI error! Uri is {}.\", value, e);\n      return INVALID_URI;\n    }\n  }\n}\n","sourceCodeStart":38,"sourceCodeEnd":61,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/FileUriKeySelector.java#L38-L61","documentation":"FileUriKeySelector.getKey() attempts to convert a string URI into an Iceberg FileURI (normalizing path with configurable equal schemes/authorities) for keying streams. If the string is not a parseable URI, the conversion throws and the selector logs a warning and returns the INVALID_URI sentinel so the record is still keyed rather than failing the job.","triggerScenarios":"getKey(value) receives a string that new Path(value).toUri() or the FileURI constructor cannot parse — e.g. malformed URI, illegal characters, null/empty string, or a scheme the normalization logic rejects.","commonSituations":"Data files referenced in manifests contain unusual URIs (spaces, unencoded characters); a catalog returns relative or scheme-less paths; streaming maintenance records carry non-file strings (e.g. metrics or serialized results) passed through the same selector.","solutions":["Log/inspect the offending 'value' and fix the producer so it emits well-formed absolute file URIs.","Check the equalSchemes/equalAuthorities configuration for typos that could break FileURI construction.","Encode special characters in URIs at write time (spaces as %20, etc.).","If INVALID_URI keys are acceptable and expected, raise log filtering or handle them explicitly downstream."],"exampleFix":"// before: raw path with illegal characters\nString path = \"/warehouse/table/dir with space/file.parquet\";\n// after: encode before it reaches the selector\nString path = \"/warehouse/table/dir%20with%20space/file.parquet\";","handlingStrategy":"validation","validationCode":"boolean validUri = value != null && !value.isEmpty() && new Path(value).toUri() != null && new Path(value).toUri().getScheme() != null;","typeGuard":"boolean isParsableUri(String value) {\n  try { new Path(value); return true; } catch (Exception e) { return false; }\n}","tryCatchPattern":null,"preventionTips":["Store fully-qualified, URL-encoded absolute file URIs in manifests/catalogs","Verify equalSchemes/equalAuthorities config before deploying","Handle INVALID_URI-keyed records explicitly downstream"],"tags":["flink","uri-parsing","keying","maintenance"],"backgroundTag":"invalid-url-format","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}