prestodb/presto · error · PrestoException

GENERIC_USER_ERROR

GENERIC_USER_ERROR

Error message

unknown data format '%s' used for column '%s'

What it means

JsonRowDecoderFactory.chooseFieldDecoder switches on the column's declared dataFormat string (known values include e.g. 'rfc2822', 'milliseconds-since-epoch', and '' for default). An unrecognized dataFormat hits the default branch and throws IllegalArgumentException, which the factory converts to PrestoException GENERIC_USER_ERROR. It is a configuration error in the column mapping.

Source

Thrown at presto-record-decoder/src/main/java/com/facebook/presto/decoder/json/JsonRowDecoderFactory.java:79

            requireNonNull(column);
            checkArgument(!column.isInternal(), "unexpected internal column '%s'", column.getName());

            String dataFormat = Optional.ofNullable(column.getDataFormat()).orElse("");
            switch (dataFormat) {
                case "custom-date-time":
                    return new CustomDateTimeJsonFieldDecoder(column);
                case "iso8601":
                    return new ISO8601JsonFieldDecoder(column);
                case "seconds-since-epoch":
                    return new SecondsSinceEpochJsonFieldDecoder(column);
                case "milliseconds-since-epoch":
                    return new MillisecondsSinceEpochJsonFieldDecoder(column);
                case "rfc2822":
                    return new RFC2822JsonFieldDecoder(column);
                case "":
                    return new DefaultJsonFieldDecoder(column);
                default:
                    throw new IllegalArgumentException(format("unknown data format '%s' used for column '%s'", column.getDataFormat(), column.getName()));
            }
        }
        catch (IllegalArgumentException e) {
            throw new PrestoException(GENERIC_USER_ERROR, e);
        }
    }

    public static JsonFieldDecoder throwUnsupportedColumnType(DecoderColumnHandle column)
    {
        if (column.getDataFormat() == null) {
            throw new IllegalArgumentException(format("unsupported column type '%s' for column '%s'", column.getType().getDisplayName(), column.getName()));
        }
        throw new IllegalArgumentException(format("unsupported column type '%s' for column '%s' with data format '%s'", column.getType(), column.getName(), column.getDataFormat()));
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the exact dataFormat string against the supported list for JsonRowDecoderFactory (e.g. iso8601, rfc2822, milliseconds-since-epoch, custom-date-time, '' for default)
  2. Correct the typo/casing in the column mapping
  3. Remove dataFormat (use default) if no special format is needed
  4. Validate table definitions with the connector's supported format docs before deploying

Example fix

// before
{"name":"ts","type":"timestamp","dataFormat":"iso-8601"}
// after
{"name":"ts","type":"timestamp","dataFormat":"iso8601"}
Defensive patterns

Strategy: validation

Validate before calling

java.util.Set<String> allowed = java.util.Set.of("iso8601","rfc2822","custom-date-time","milliseconds-since-epoch","seconds-since-epoch","iso8601-date-time","custom","milliseconds-since-epoch","unix-time-seconds","""); boolean ok = allowed.contains(column.getDataFormat() == null ? "" : column.getDataFormat().toLowerCase());

Try / catch

try { RowDecoder d = factory.create(columns); } catch (PrestoException e) { if (e.getErrorCode().getCode() == StandardErrorCode.GENERIC_USER_ERROR.getCode()) { failFastWithConfigDump(e.getMessage()); } else throw e; }

Prevention

When it happens

Trigger: A DecoderColumnHandle declares dataFormat set to a string not in the supported set (typo like 'iso-8601' instead of 'iso8601', or a format only supported by other connectors), while the column type itself is otherwise valid.

Common situations: Misspelled dataFormat in Kafka topic definition JSON; copying mappings between connectors with different format vocabularies; case sensitivity mistakes ('ISO8601' vs 'iso8601').

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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