{"record":{"id":"9dd8ccd3b980c6a1","repo":"OpenRefine/OpenRefine","slug":"inconsistent-number-of-properties-fetched-and-of-r","errorCode":null,"errorMessage":"Inconsistent number of properties fetched and of result column names","messagePattern":"Inconsistent number of properties fetched and of result column names","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"main/src/com/google/refine/operations/recon/ExtendDataOperation.java","lineNumber":112,"sourceCode":"            @JsonProperty(\"engineConfig\") EngineConfig engineConfig,\n            @JsonProperty(\"baseColumnName\") String baseColumnName,\n            @JsonProperty(\"endpoint\") String endpoint,\n            @JsonProperty(\"identifierSpace\") String identifierSpace,\n            @JsonProperty(\"schemaSpace\") String schemaSpace,\n            @JsonProperty(\"extension\") DataExtensionConfig extension,\n            @JsonProperty(\"columnInsertIndex\") int columnInsertIndex,\n            @JsonProperty(\"resultColumnNames\") List<String> resultColumnNames) {\n        super(engineConfig);\n\n        _baseColumnName = baseColumnName;\n        _endpoint = endpoint;\n        _identifierSpace = identifierSpace;\n        _schemaSpace = schemaSpace;\n        _extension = extension;\n        _columnInsertIndex = columnInsertIndex;\n        _resultColumnNames = resultColumnNames;\n        if (_resultColumnNames != null && _extension.properties.size() != _resultColumnNames.size()) {\n            throw new IllegalArgumentException(\"Inconsistent number of properties fetched and of result column names\");\n        }\n    }\n\n    /**\n     * @deprecated legacy constructor: supply column names instead\n     */\n    @Deprecated(since = \"3.9\")\n    public ExtendDataOperation(\n            EngineConfig engineConfig,\n            String baseColumnName,\n            String endpoint,\n            String identifierSpace,\n            String schemaSpace,\n            DataExtensionConfig extension,\n            int columnInsertIndex) {\n        this(engineConfig, baseColumnName, endpoint, identifierSpace, schemaSpace, extension, columnInsertIndex, null);\n    }\n","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/OpenRefine/OpenRefine/blob/a946177e049f3b0644261661db36cbb0c81ccf8a/main/src/com/google/refine/operations/recon/ExtendDataOperation.java#L94-L130","documentation":"The ExtendDataOperation constructor validates that the number of properties in the column extension matches the number of supplied result column names, since each fetched property maps to exactly one new column. A mismatch throws an IllegalArgumentException in the constructor.","triggerScenarios":"Constructing ExtendDataOperation (or deserializing it from operation JSON) where extension.properties.length != resultColumnNames.length, e.g. hand-editing the JSON to add properties without updating column names.","commonSituations":"Writing 'Add columns from reconciled values' operations programmatically; editing exported operation JSON to add a property to fetch; upgrading legacy operations that used the deprecated no-names constructor.","solutions":["Make resultColumnNames contain exactly one name per property in the extension, in the same order","Regenerate the operation via the 'Add columns from reconciled values' dialog instead of editing JSON","If using the deprecated legacy constructor, migrate to the constructor/API that takes explicit column names","Count extension.properties and adjust resultColumnNames to the same length"],"exampleFix":"// before: 2 properties, 1 name\nnew ExtendDataOperation(base, \"wd:Q1\", ids, schema, ext(2 props), 1, List.of(\"name\"))\n// after\nnew ExtendDataOperation(base, \"wd:Q1\", ids, schema, ext(2 props), 1, List.of(\"name\",\"birthdate\"))","handlingStrategy":"validation","validationCode":"if (extension.properties.length !== resultColumnNames.length) {\n  throw new Error('resultColumnNames must have one entry per extension property');\n}","typeGuard":null,"tryCatchPattern":"try {\n  ExtendDataOperation op = new ExtendDataOperation(...);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Inconsistent number of properties\")) {\n    // fix the column name list\n  }\n}","preventionTips":["Build resultColumnNames from the same loop that builds extension.properties","Never add a property to exported JSON without adding the matching column name","Prefer the dialog-generated JSON over hand edits","Migrate away from the deprecated legacy constructor"],"tags":["java","reconciliation","constructor","validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"a946177e049f3b0644261661db36cbb0c81ccf8a","analyzedAt":"2026-09-08T10:21:27.735Z","contentChangedAt":"2026-09-08T10:21:27.735Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}