{"record":{"id":"7f8d8a86d2036422","repo":"apache/druid","slug":"the-s-property-cannot-be-provided-when-the-s-pro","errorCode":null,"errorMessage":"The %s property cannot be provided when the %s property is set","messagePattern":"The (.+?) property cannot be provided when the (.+?) property is set","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-core/s3-extensions/src/main/java/org/apache/druid/catalog/model/table/S3InputSourceDefn.java","lineNumber":164,"sourceCode":"    final String bucket = table.resolvedTable().stringProperty(BUCKET_PROPERTY);\n    final boolean hasBucket = bucket != null;\n    final Map<String, Object> sourceMap = table.inputSourceMap;\n    final boolean hasUris = sourceMap.containsKey(URIS_FIELD);\n    final boolean hasPrefix = sourceMap.containsKey(PREFIXES_FIELD);\n    final boolean hasObjects = sourceMap.containsKey(OBJECTS_FIELD);\n    final boolean hasGlob = sourceMap.containsKey(OBJECT_GLOB_FIELD);\n    if (hasBucket) {\n      if (hasUris || hasPrefix || hasObjects) {\n        throw new IAE(\n            \"Provide either the %s property, or one of the S3 input source fields %s, %s or %s, but not both.\",\n            BUCKET_PROPERTY,\n            URIS_FIELD,\n            PREFIXES_FIELD,\n            OBJECTS_FIELD\n        );\n      }\n      if (hasGlob) {\n        throw new IAE(\n            \"The %s property cannot be provided when the %s property is set\",\n            OBJECT_GLOB_FIELD,\n            BUCKET_PROPERTY\n        );\n      }\n\n      // Patch in a dummy URI so that validation of the rest of the fields\n      // will pass.\n      sourceMap.put(URIS_FIELD, Collections.singletonList(bucket));\n    }\n    super.validate(table);\n  }\n\n  @Override\n  protected List<ParameterDefn> adHocTableFnParameters()\n  {\n    return CatalogUtils.concatLists(\n        Arrays.asList(","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/s3-extensions/src/main/java/org/apache/druid/catalog/model/table/S3InputSourceDefn.java#L146-L182","documentation":"When an S3 catalog table uses the bucket property, object-level filtering via objectGlob is not allowed because the bucket style maps the whole bucket to a synthetic URI and glob filtering is applied differently. Druid throws this IllegalArgumentException if objectGlob appears in the inputSourceMap together with the bucket property. Use prefixes/uris style if glob filtering is needed.","triggerScenarios":"Calling validate() on a ResolvedExternalTable where the bucket property is set and the inputSourceMap also contains the objectGlob key.","commonSituations":"Users copying objectGlob from a raw S3InputSource config while also filling in the catalog bucket property; trying to restrict ingestion to *.json files while using the simpler bucket-based spec.","solutions":["Remove objectGlob from the inputSourceMap and rely on the bucket (or add prefixes instead of bucket to enable glob)","Drop the bucket property and use uris/prefixes with objectGlob for filtered reads","Broaden the bucket path so glob filtering is unnecessary"],"exampleFix":"// before\n{\"bucket\": \"my-bucket\", \"inputSource\": {\"type\": \"s3\", \"objectGlob\": \"**/*.json\"}}\n// after\n{\"inputSource\": {\"type\": \"s3\", \"prefixes\": [\"s3://my-bucket/data/\"], \"objectGlob\": \"**/*.json\"}}","handlingStrategy":"validation","validationCode":"if (spec.stringProperty(\"bucket\") != null && spec.inputSourceMap.containsKey(\"objectGlob\")) {\n  throw new IllegalArgumentException(\"objectGlob cannot be used with the bucket property\");\n}","typeGuard":"boolean globAllowedWithBucket(String bucket, Map<String, Object> src) {\n  return bucket == null || !src.containsKey(\"objectGlob\");\n}","tryCatchPattern":"try {\n  tableDefn.validate(table);\n} catch (IllegalArgumentException e) {\n  // remove objectGlob or switch to prefixes-style addressing\n}","preventionTips":["Use the bucket property only for whole-bucket reads","Reserve objectGlob for specs using uris/prefixes","Document glob filtering needs in table spec comments to avoid mixing styles"],"tags":["s3","catalog","conflicting-parameters","validation"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}