{"record":{"id":"0d9cdf0f742b445d","repo":"prestodb/presto","slug":"lance-type-not-supported","errorCode":"LANCE_TYPE_NOT_SUPPORTED","errorMessage":"Unsupported type for Arrow conversion: \" + type","messagePattern":"Unsupported type for Arrow conversion: \" \\+ type","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-lance/src/main/java/com/facebook/presto/lance/LancePageToArrowConverter.java","lineNumber":116,"sourceCode":"            else if (type instanceof DoubleType) {\n                ((Float8Vector) vector).setSafe(targetIndex, type.getDouble(block, i));\n            }\n            else if (type instanceof VarcharType) {\n                byte[] bytes = type.getSlice(block, i).getBytes();\n                ((VarCharVector) vector).setSafe(targetIndex, bytes);\n            }\n            else if (type instanceof VarbinaryType) {\n                byte[] bytes = type.getSlice(block, i).getBytes();\n                ((VarBinaryVector) vector).setSafe(targetIndex, bytes);\n            }\n            else if (type instanceof DateType) {\n                ((DateDayVector) vector).setSafe(targetIndex, (int) type.getLong(block, i));\n            }\n            else if (type instanceof TimestampType) {\n                ((TimeStampMicroVector) vector).setSafe(targetIndex, type.getLong(block, i));\n            }\n            else {\n                throw new PrestoException(LanceErrorCode.LANCE_TYPE_NOT_SUPPORTED,\n                        \"Unsupported type for Arrow conversion: \" + type);\n            }\n        }\n    }\n}\n","sourceCodeStart":98,"sourceCodeEnd":122,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-lance/src/main/java/com/facebook/presto/lance/LancePageToArrowConverter.java#L98-L122","documentation":"LancePageToArrowConverter.writeBlockToVectorAtOffset converts Presto blocks into Apache Arrow vectors column by column. It only knows how to map a fixed set of Presto types to Arrow vectors (DateDayVector, TimeStampMicroVector, etc.); when it encounters a block whose declared Type is not one of the supported Arrow-mappable types, it throws LanceErrorCode.LANCE_TYPE_NOT_SUPPORTED. This is a static schema-compatibility failure: the connector cannot represent the column's Presto type in Arrow format for Lance.","triggerScenarios":"SELECTing or pushing down a Lance table column whose Presto type falls outside the converter's supported mapping (e.g. a complex/unmapped type like MAP, ARRAY, ROW, or an unsupported primitive) while reading data through the Lance connector; the throw happens inside the per-row write loop in writeBlockToVectorAtOffset, invoked from writeBlockToVector during page conversion.","commonSituations":"Lance schema evolved to include a new field type not yet mapped in the connector; a CREATE TABLE or CTAS with an unsupported column type; a user casting a column to an exotic type upstream and expecting the connector to translate it; connector version older than the type being queried.","solutions":["Cast the unsupported column to a supported type in the query (e.g. CAST(col AS VARCHAR), CAST(col AS DATE), CAST(col AS TIMESTAMP)) before it reaches the Lance connector.","Inspect the Lance table schema (via show columns / Lance tooling) and drop or alter columns with unsupported types.","Upgrade the presto-lance connector to a version that maps the missing type in LancePageToArrowConverter.","If you maintain the connector, add an else-if branch mapping the type to the appropriate Arrow vector."],"exampleFix":"// before: SELECT * FROM lance.table WHERE unsupported_map_col IS NOT NULL;\n-- after\nSELECT * FROM lance.table WHERE json_format(CAST(unsupported_map_col AS JSON)) IS NOT NULL;\n-- or in DDL\nCREATE TABLE lance.t (ts TIMESTAMP); -- instead of unsupported type","handlingStrategy":"try-catch","validationCode":"-- run before querying\nSHOW COLUMNS FROM lance.my_table;\n-- verify every column type is a supported primitive (varchar, bigint, date, timestamp, double)","typeGuard":null,"tryCatchPattern":"try (QueryResult r = execute(\"SELECT * FROM lance.t\")) { ... } catch (PrestoException e) { if (\"LANCE_TYPE_NOT_SUPPORTED\".equals(e.getErrorCode().getName())) { // fallback: cast unsupported columns to VARCHAR/JSON in a follow-up query } else { throw e; } }","preventionTips":["Keep Lance table schemas to connector-supported Arrow-mappable types","CAST complex types to JSON/VARCHAR before querying through the Lance connector","Review SHOW COLUMNS after any schema evolution on the Lance side","Pin connector version consistent with the Lance writer version"],"tags":["presto-connector","arrow","type-mapping","lance"],"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"}