{"record":{"id":"b8f0991ab516ab5a","repo":"apache/druid","slug":"the-local-input-source-has-a-file-list-do-not-pro","errorCode":null,"errorMessage":"The local input source has a file list: do not provide other arguments","messagePattern":"The local input source has a file list: do not provide other arguments","errorType":"validation","errorClass":"IAE","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java","lineNumber":211,"sourceCode":"    // Does the table define a format?\n    if (table.inputFormatMap == null) {\n      params = addFormatParameters(params);\n    }\n    return new PartialTableFunction(table, params);\n  }\n\n  @Override\n  protected ExternalTableSpec convertCompletedTable(\n      final ResolvedExternalTable table,\n      final Map<String, Object> args,\n      final List<ColumnSpec> columns\n  )\n  {\n    final Map<String, Object> sourceMap = new HashMap<>(table.inputSourceMap);\n    final boolean hasFiles = !CollectionUtils.isNullOrEmpty(CatalogUtils.safeGet(sourceMap, FILES_FIELD, List.class));\n    if (hasFiles) {\n      if (!args.isEmpty()) {\n        throw new IAE(\"The local input source has a file list: do not provide other arguments\");\n      }\n    } else {\n      final String baseDir = CatalogUtils.getString(sourceMap, BASE_DIR_FIELD);\n      if (Strings.isNullOrEmpty(baseDir)) {\n        throw new IAE(\n            \"When a local external table is used with a table function, %s must be set\",\n            BASE_DIR_FIELD\n        );\n      }\n      final boolean hasFilter = !Strings.isNullOrEmpty(CatalogUtils.getString(sourceMap, FILTER_FIELD));\n      final List<String> filesParam = CatalogUtils.getStringArray(args, FILES_PARAMETER);\n      final boolean hasFilesParam = !CollectionUtils.isNullOrEmpty(filesParam);\n      final String filterParam = CatalogUtils.getString(args, FILTER_PARAMETER);\n      final boolean hasFilterParam = !Strings.isNullOrEmpty(filterParam);\n      if (!hasFilter && !hasFilesParam && !hasFilterParam) {\n        throw new IAE(\n            \"For a local input source, set either %s or %s\",\n            FILES_PARAMETER,","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java#L193-L229","documentation":"When a defined local external table already stores a files list in its input source, the table function form takes no further arguments — the file selection is fully determined. Passing any extra arguments to such a table's table function is rejected by convertCompletedTable with this IAE.","triggerScenarios":"Calling TABLE(...) on a catalog external table whose inputSourceMap contains a non-empty files field, while passing one or more table-function arguments (e.g. files, filter, baseDir, or format params).","commonSituations":"Reusing a generic TABLE(...) invocation template across tables; adding a filter thinking it narrows the already-fixed file list; migrating a baseDir-style table to a files-style one without updating call sites.","solutions":["Call the table function with no arguments: TABLE('myTable')","Remove the arguments from the call; the stored files list is authoritative","If dynamic selection is needed, redefine the table with baseDir instead of files, then pass files/filter as function arguments"],"exampleFix":"// before\nSELECT * FROM TABLE(myFilesTable(FILES => ARRAY['x.json']))\n// after\nSELECT * FROM TABLE(myFilesTable())","handlingStrategy":"validation","validationCode":"// Java\n// Before calling the table function on a table with a files list:\nif (!args.isEmpty()) throw new IllegalArgumentException(\"files-backed tables take no function arguments\");","typeGuard":null,"tryCatchPattern":"try { fn.call(args); } catch (IAE e) { if (e.getMessage().contains(\"do not provide other arguments\")) fn.call(Map.of()); else throw e; }","preventionTips":["Check whether the table definition stores files before adding function args","Use TABLE(name) with no args for files-backed tables","Avoid a one-size-fits-all TABLE(...) template for all local tables"],"tags":["druid-catalog","validation","table-function","local-input-source"],"backgroundTag":"invalid-argument","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}