{"record":{"id":"d3e67ac4a1ea0c94","repo":"apache/flink","slug":"type-at-position-is-not-a-basic-type","errorCode":null,"errorMessage":"Type at position {} is not a basic type.","messagePattern":"Type at position (.+?) is not a basic type\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfo.java","lineNumber":223,"sourceCode":"\n    // --------------------------------------------------------------------------------------------\n\n    @PublicEvolving\n    public static <X extends Tuple> TupleTypeInfo<X> getBasicTupleTypeInfo(Class<?>... basicTypes) {\n        if (basicTypes == null || basicTypes.length == 0) {\n            throw new IllegalArgumentException();\n        }\n\n        TypeInformation<?>[] infos = new TypeInformation<?>[basicTypes.length];\n        for (int i = 0; i < infos.length; i++) {\n            Class<?> type = basicTypes[i];\n            if (type == null) {\n                throw new IllegalArgumentException(\"Type at position \" + i + \" is null.\");\n            }\n\n            TypeInformation<?> info = BasicTypeInfo.getInfoFor(type);\n            if (info == null) {\n                throw new IllegalArgumentException(\n                        \"Type at position \" + i + \" is not a basic type.\");\n            }\n            infos[i] = info;\n        }\n\n        @SuppressWarnings(\"unchecked\")\n        TupleTypeInfo<X> tupleInfo = (TupleTypeInfo<X>) new TupleTypeInfo<Tuple>(infos);\n        return tupleInfo;\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    @PublicEvolving\n    public static <X extends Tuple> TupleTypeInfo<X> getBasicAndBasicValueTupleTypeInfo(\n            Class<?>... basicTypes) {\n        if (basicTypes == null || basicTypes.length == 0) {\n            throw new IllegalArgumentException();\n        }\n","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfo.java#L205-L241","documentation":"Thrown by TupleTypeInfo.getBasicTupleTypeInfo(Class<?>...) when BasicTypeInfo.getInfoFor(type) returns null — meaning the Class is not one of Flink's recognized basic types (String, Boolean, Byte, Short, Integer, Long, Float, Double, Character, Date, Void, BigInteger, BigDecimal, or SQL date/time types). This is a plain IllegalArgumentException.","triggerScenarios":"Calling TupleTypeInfo.getBasicTupleTypeInfo(MyCustomClass.class) or getBasicTupleTypeInfo(int[].class). BasicTypeInfo.getInfoFor only recognizes primitive wrappers and a handful of JDK types.","commonSituations":"Developer passes a custom POJO, enum, array, or collection class to a method that only accepts basic types. Common when migrating from a generic Tuple<Object,...> or when assuming Flink supports arbitrary classes in getBasicTupleTypeInfo.","solutions":["Use only basic types: String, Boolean, Byte, Short, Integer, Long, Float, Double, Character, Date, Void, BigInteger, BigDecimal.","For non-basic types use 'new TupleTypeInfo<>(typeInfo1, typeInfo2, ...)' with explicit TypeInformation objects instead of the basic-only factory.","For custom classes, use TypeInformation.of(MyClass.class) and pass it to the TupleTypeInfo constructor."],"exampleFix":"// before\nTupleTypeInfo.getBasicTupleTypeInfo(MyPojo.class, Integer.class);\n// after\nnew TupleTypeInfo<>(TypeInformation.of(MyPojo.class), Types.INT);","handlingStrategy":"validation","validationCode":"Set<Class<?>> BASIC = Set.of(\n    String.class, Boolean.class, Byte.class, Short.class,\n    Integer.class, Long.class, Float.class, Double.class,\n    Character.class, Date.class, Void.class,\n    BigInteger.class, BigDecimal.class);\nfor (Class<?> c : basicTypes) {\n    if (!BASIC.contains(c)) {\n        throw new IllegalArgumentException(\n            \"Not a basic type: \" + c);\n    }\n}","typeGuard":"boolean isBasicType(Class<?> c) {\n    return BasicTypeInfo.getInfoFor(c) != null;\n}","tryCatchPattern":null,"preventionTips":["Only pass basic/primitive-wrapper types to getBasicTupleTypeInfo.","For custom types use the TupleTypeInfo constructor with explicit TypeInformation."],"tags":["tuple","basic-type","type-system","factory-method","flink-core"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}