prestodb/presto · error · PrestoException

LANCE_TYPE_NOT_SUPPORTED

LANCE_TYPE_NOT_SUPPORTED

Error message

Unsupported type for Arrow conversion: " + type

What it means

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.

Source

Thrown at presto-lance/src/main/java/com/facebook/presto/lance/LancePageToArrowConverter.java:116

            else if (type instanceof DoubleType) {
                ((Float8Vector) vector).setSafe(targetIndex, type.getDouble(block, i));
            }
            else if (type instanceof VarcharType) {
                byte[] bytes = type.getSlice(block, i).getBytes();
                ((VarCharVector) vector).setSafe(targetIndex, bytes);
            }
            else if (type instanceof VarbinaryType) {
                byte[] bytes = type.getSlice(block, i).getBytes();
                ((VarBinaryVector) vector).setSafe(targetIndex, bytes);
            }
            else if (type instanceof DateType) {
                ((DateDayVector) vector).setSafe(targetIndex, (int) type.getLong(block, i));
            }
            else if (type instanceof TimestampType) {
                ((TimeStampMicroVector) vector).setSafe(targetIndex, type.getLong(block, i));
            }
            else {
                throw new PrestoException(LanceErrorCode.LANCE_TYPE_NOT_SUPPORTED,
                        "Unsupported type for Arrow conversion: " + type);
            }
        }
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. 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.
  2. Inspect the Lance table schema (via show columns / Lance tooling) and drop or alter columns with unsupported types.
  3. Upgrade the presto-lance connector to a version that maps the missing type in LancePageToArrowConverter.
  4. If you maintain the connector, add an else-if branch mapping the type to the appropriate Arrow vector.

Example fix

// before: SELECT * FROM lance.table WHERE unsupported_map_col IS NOT NULL;
-- after
SELECT * FROM lance.table WHERE json_format(CAST(unsupported_map_col AS JSON)) IS NOT NULL;
-- or in DDL
CREATE TABLE lance.t (ts TIMESTAMP); -- instead of unsupported type
Defensive patterns

Strategy: try-catch

Validate before calling

-- run before querying
SHOW COLUMNS FROM lance.my_table;
-- verify every column type is a supported primitive (varchar, bigint, date, timestamp, double)

Try / catch

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; } }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/0d9cdf0f742b445d. Report an issue: GitHub.