{"record":{"id":"355ae4f3617dd351","repo":"prestodb/presto","slug":"only-bigint-integer-and-varchar-blocks-are-suppor","errorCode":null,"errorMessage":"Only bigint, integer and varchar blocks are supported","messagePattern":"Only bigint, integer and varchar blocks are supported","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-thrift-testing-server/src/main/java/com/facebook/presto/connector/thrift/server/ThriftIndexedTpchService.java","lineNumber":190,"sourceCode":"            for (int index = begin; index < end; index++) {\n                if (nulls != null && nulls[index]) {\n                    result.add(null);\n                }\n                else {\n                    checkArgument(sizes != null, \"block structure is incorrect\");\n                    if (sizes[index] == 0) {\n                        result.add(\"\");\n                    }\n                    else {\n                        checkArgument(bytes != null);\n                        result.add(new String(bytes, startOffset, sizes[index]));\n                        startOffset += sizes[index];\n                    }\n                }\n            }\n        }\n        else {\n            throw new IllegalArgumentException(\"Only bigint, integer and varchar blocks are supported\");\n        }\n        return result;\n    }\n\n    private static List<Integer> computeRemap(List<String> startSchema, List<String> endSchema)\n    {\n        ImmutableList.Builder<Integer> builder = ImmutableList.builder();\n        for (String columnName : endSchema) {\n            int index = startSchema.indexOf(columnName);\n            checkArgument(index != -1, \"Column name in end that is not in the start: %s\", columnName);\n            builder.add(index);\n        }\n        return builder.build();\n    }\n}\n","sourceCodeStart":172,"sourceCodeEnd":206,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-thrift-testing-server/src/main/java/com/facebook/presto/connector/thrift/server/ThriftIndexedTpchService.java#L172-L206","documentation":"ThriftIndexedTpchService.blockAsList() converts a Presto Block column into a Java list for the Thrift testing server, but only supports bigint, integer, and varchar block types. Any other type (e.g., double, date, arrays) reaches the else branch and throws IllegalArgumentException. This is a deliberate limitation of the in-memory TPCH test service, not the production Thrift connector.","triggerScenarios":"Querying the thrift testing server (ThriftIndexedTpchService) with a query that selects or indexes on a column whose block type is not bigint, integer, or varchar.","commonSituations":"Test queries adding non-supported column types to a TPCH table; new columns/types added to the test schema without extending blockAsList; framework changes passing differently-typed blocks.","solutions":["Restrict test queries to bigint, integer, and varchar columns","Extend blockAsList() with a case for the needed Type (and its read path) and add a test","Switch the column to a supported type in the test schema","Use a different connector/service if non-primitive types are required"],"exampleFix":"// before\n} else {\n    throw new IllegalArgumentException(\"Only bigint, integer and varchar blocks are supported\");\n}\n// after\n} else if (blockType == DOUBLE) {\n    // handle double blocks\n} else {\n    throw new IllegalArgumentException(\"Only bigint, integer, double and varchar blocks are supported\");\n}","handlingStrategy":"validation","validationCode":"Type type = block.getType();\nif (!type.equals(BIGINT) && !type.equals(INTEGER) && !type.equals(VARCHAR)) {\n    throw new IllegalArgumentException(\"unsupported type for thrift test server: \" + type);\n}","typeGuard":"boolean isSupportedBlockType(Type t) {\n    return t.equals(BIGINT) || t.equals(INTEGER) || t.equals(VARCHAR);\n}","tryCatchPattern":null,"preventionTips":["Restrict thrift-testing-server queries to bigint/integer/varchar columns","Extend blockAsList() when adding new column types to the test schema","Keep test schemas minimal and documented"],"tags":["thrift","testing","unsupported-type"],"backgroundTag":"unsupported-column-type","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"}