{"record":{"id":"bf84e7e9db7ff5a8","repo":"OtterMind/Chat2DB","slug":"unsupported-hive-index-type-type","errorCode":null,"errorMessage":"Unsupported Hive index type: {type}","messagePattern":"Unsupported Hive index type: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"chat2db-community-server/chat2db-community-plugins/chat2db-community-hive/src/main/java/ai/chat2db/plugin/hive/builder/HiveSqlBuilder.java","lineNumber":126,"sourceCode":"        script.append(SQL_CREATE_TABLE);\n        if (StringUtils.isNotBlank(table.getDatabaseName())) {\n            script.append(HiveIdentifierProcessor.INSTANCE.quoteIdentifierAlways(table.getDatabaseName())).append(SQLConstants.DOT);\n        }\n        script.append(HiveIdentifierProcessor.INSTANCE.quoteIdentifierAlways(table.getName())).append(SQLConstants.SPACE_OPEN_PARENTHESIS).append(SQLConstants.LINE_SEPARATOR);\n        for (TableColumn column : table.getColumnList()) {\n            if (StringUtils.isBlank(column.getName()) || StringUtils.isBlank(column.getColumnType())) {\n                continue;\n            }\n            script.append(SQLConstants.TAB).append(HiveColumnTypeEnum.buildCreateColumnSqlSafely(column))\n                    .append(SQLConstants.COMMA_LINE_SEPARATOR);\n        }\n        for (TableIndex tableIndex : table.getIndexList()) {\n            if (StringUtils.isBlank(tableIndex.getName()) || StringUtils.isBlank(tableIndex.getType())) {\n                continue;\n            }\n            HiveIndexTypeEnum hiveIndexTypeEnum = HiveIndexTypeEnum.getByType(tableIndex.getType());\n            if (hiveIndexTypeEnum == null) {\n                throw new IllegalArgumentException(\"Unsupported Hive index type: \" + tableIndex.getType());\n            }\n            script.append(SQLConstants.TAB).append(SQLConstants.EMPTY).append(hiveIndexTypeEnum.buildIndexScript(tableIndex)).append(SQLConstants.COMMA_LINE_SEPARATOR);\n        }\n\n        script = new StringBuilder(script.substring(0, script.length() - 2));\n        script.append(SQLConstants.LINE_SEPARATOR_CLOSE_PARENTHESIS);\n\n\n        if (StringUtils.isNotBlank(table.getEngine())) {\n            script.append(SQLConstants.ENGINE_SQL).append(HiveSqlGuards.requireHiveName(table.getEngine(), \"engine\"));\n        }\n\n        if (StringUtils.isNotBlank(table.getCharset())) {\n            script.append(SQLConstants.DEFAULT_CHARACTER_SET_SQL).append(HiveSqlGuards.requireHiveName(table.getCharset(), \"charset\"));\n        }\n\n        if (StringUtils.isNotBlank(table.getCollate())) {\n            script.append(SQLConstants.COLLATE_SQL).append(HiveSqlGuards.requireHiveName(table.getCollate(), \"collation\"));","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-server/chat2db-community-plugins/chat2db-community-hive/src/main/java/ai/chat2db/plugin/hive/builder/HiveSqlBuilder.java#L108-L144","documentation":"Thrown in HiveSqlBuilder.createTable when HiveIndexTypeEnum.getByType(tableIndex.getType()) returns null, i.e. the index type string is not one of the recognized Hive index types. It only fires when the index already passed the blank-name/blank-type skip filter, so a non-null unknown type reaches the lookup.","triggerScenarios":"Building a CREATE TABLE for Hive where table.getIndexList() contains a TableIndex whose type is a non-blank but unsupported string (e.g. \"FULLTEXT\", \"SPATIAL\", a MySQL-style type).","commonSituations":"Reusing a TableIndex model from MySQL/PostgreSQL inside the Hive builder; a UI exposing all dialect index types to Hive; a typo in the index type.","solutions":["Use only Hive-supported index type strings that HiveIndexTypeEnum recognizes.","Filter the index list to Hive-supported types before building CREATE TABLE.","If the index is not relevant to Hive, remove it from table.getIndexList() for that build."],"exampleFix":"// before\ntable.getIndexList().add(idxWithFulltext); // type \"FULLTEXT\"\nnew HiveSqlBuilder().createTable(table);\n\n// after\ntable.setIndexList(table.getIndexList().stream()\n    .filter(i -> HiveIndexTypeEnum.getByType(i.getType()) != null)\n    .toList());\nnew HiveSqlBuilder().createTable(table);","handlingStrategy":"validation","validationCode":"static boolean isSupportedHiveIndexType(String type) {\n    return StringUtils.isNotBlank(type) && ai.chat2db.plugin.hive.enums.type.HiveIndexTypeEnum.getByType(type) != null;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only Hive-recognized index type strings in the create path.","Filter the index list to Hive-supported types before calling the builder.","Do not reuse MySQL/PostgreSQL index models for the Hive builder."],"tags":["hive","ddl","index","builder","validation"],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}