prestodb/presto · error · PrestoException

INVALID_FUNCTION_ARGUMENT

INVALID_FUNCTION_ARGUMENT

Error message

Input type %s not supported

What it means

Specialization-time type guard in ArrayJoin.specializeArrayJoin: the element type of the array argument has no VARCHAR cast implementation available, so the generated array_join code cannot be compiled for this input type.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ArrayJoin.java:269

                MethodHandle targetStack = MethodHandles.insertArguments(methodHandleStack, 0, cast);
                MethodHandle targetProvidedBlock = MethodHandles.insertArguments(methodHandleProvidedBlock, 0, cast);
                return new BuiltInScalarFunctionImplementation(
                        ImmutableList.of(
                                new ScalarFunctionImplementationChoice(
                                        false,
                                        argumentProperties,
                                        STACK,
                                        targetStack,
                                        Optional.empty()),
                                new ScalarFunctionImplementationChoice(
                                        false,
                                        argumentProperties,
                                        PROVIDED_BLOCKBUILDER,
                                        targetProvidedBlock,
                                        Optional.empty())));
            }
            catch (PrestoException e) {
                throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Input type %s not supported", type), e);
            }
        }
    }

    @UsedByGeneratedCode
    public static Slice arrayJoinStack(
            MethodHandle castFunction,
            SqlFunctionProperties properties,
            Block arrayBlock,
            Slice delimiter)
    {
        return arrayJoinStack(castFunction, properties, arrayBlock, delimiter, null);
    }

    @UsedByGeneratedCode
    public static void arrayJoinProvidedBlock(
            MethodHandle castFunction,
            SqlFunctionProperties properties,

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Cast the array to array(varchar) before calling array_join
  2. Use an element type with a built-in VARCHAR cast
  3. Format non-castable types to strings first via transform
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ArrayJoin.java:269 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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