{"record":{"id":"85e9982b16c850e7","repo":"prestodb/presto","slug":"not-found-85e998","errorCode":"NOT_FOUND","errorMessage":"Table %s.%s does not have columns %s","messagePattern":"Table (.+?)\\.(.+?) does not have columns (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java","lineNumber":576,"sourceCode":"        return new WriterParameters(\n                UpdateMode.NEW,\n                getHiveSchema(table),\n                writerInfo,\n                fromHiveStorageFormat(storageFormat));\n    }\n\n    private void validateSchema(Optional<String> partitionName, Properties schema)\n    {\n        // existing tables may have columns in a different order\n        List<String> fileColumnNames = Splitter.on(',').trimResults().omitEmptyStrings().splitToList(schema.getProperty(META_TABLE_COLUMNS, \"\"));\n        List<HiveType> fileColumnHiveTypes = toHiveTypes(schema.getProperty(META_TABLE_COLUMN_TYPES, \"\"));\n\n        // verify we can write all input columns to the file\n        Map<String, DataColumn> inputColumnMap = dataColumns.stream()\n                .collect(toMap(DataColumn::getName, identity()));\n        Set<String> missingColumns = Sets.difference(inputColumnMap.keySet(), new HashSet<>(fileColumnNames));\n        if (!missingColumns.isEmpty()) {\n            throw new PrestoException(NOT_FOUND, format(\"Table %s.%s does not have columns %s\", schema, tableName, missingColumns));\n        }\n        if (fileColumnNames.size() != fileColumnHiveTypes.size()) {\n            throw new PrestoException(HIVE_INVALID_METADATA, format(\n                    \"Partition '%s' in table '%s.%s' has mismatched metadata for column names and types\",\n                    partitionName,\n                    schemaName,\n                    tableName));\n        }\n\n        // verify the file types match the input type\n        // todo adapt input types to the file types as Hive does\n        for (int fileIndex = 0; fileIndex < fileColumnNames.size(); fileIndex++) {\n            String columnName = fileColumnNames.get(fileIndex);\n            HiveType fileColumnHiveType = fileColumnHiveTypes.get(fileIndex);\n            HiveType inputHiveType = inputColumnMap.get(columnName).getHiveType();\n\n            if (!fileColumnHiveType.equals(inputHiveType)) {\n                // todo this should be moved to a helper","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java#L558-L594","documentation":"validateSchema compares the column names/types recorded in the file's schema (hive.columns/columns.types properties) with the table's current metastore columns; this fires when writing to an existing table/partition whose stored schema lacks columns the writer expects.","triggerScenarios":"Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java:576 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the missing columns to the table (ALTER TABLE ADD COLUMN)","Align the insert's column list with the actual table columns"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}