prestodb/presto · error · PrestoException

GENERIC_INTERNAL_ERROR

GENERIC_INTERNAL_ERROR

Error message

Unknown compression algorithm ${compression} for column ${name}

What it means

When building a column schema (e.g. during CREATE TABLE), KuduClientSession.setCompression maps the table property-specified compression name to Kudu's ColumnSchema.CompressionAlgorithm. If KuduTableProperties.lookupCompression cannot resolve the name, it throws IllegalArgumentException, converted here to a PrestoException with GENERIC_INTERNAL_ERROR.

Source

Thrown at presto-kudu/src/main/java/com/facebook/presto/kudu/KuduClientSession.java:418

    {
        if (columnMetadata.getType() instanceof DecimalType) {
            DecimalType type = (DecimalType) columnMetadata.getType();
            ColumnTypeAttributes attributes = new ColumnTypeAttributes.ColumnTypeAttributesBuilder()
                    .precision(type.getPrecision())
                    .scale(type.getScale()).build();
            builder.typeAttributes(attributes);
        }
    }

    private void setCompression(String name, ColumnSchema.ColumnSchemaBuilder builder, ColumnDesign design)
    {
        if (design.getCompression() != null) {
            try {
                ColumnSchema.CompressionAlgorithm algorithm = KuduTableProperties.lookupCompression(design.getCompression());
                builder.compressionAlgorithm(algorithm);
            }
            catch (IllegalArgumentException e) {
                throw new PrestoException(GENERIC_INTERNAL_ERROR, "Unknown compression algorithm " + design.getCompression() + " for column " + name);
            }
        }
    }

    private void setEncoding(String name, ColumnSchema.ColumnSchemaBuilder builder, ColumnDesign design)
    {
        if (design.getEncoding() != null) {
            try {
                ColumnSchema.Encoding encoding = KuduTableProperties.lookupEncoding(design.getEncoding());
                builder.encoding(encoding);
            }
            catch (IllegalArgumentException e) {
                throw new PrestoException(GENERIC_INTERNAL_ERROR, "Unknown encoding " + design.getEncoding() + " for column " + name);
            }
        }
    }

    private CreateTableOptions buildCreateTableOptions(Schema schema, Map<String, Object> properties)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use a supported compression name: lz4, snappy, or zlib (check KuduTableProperties.lookupCompression)
  2. Upgrade the Kudu client/server if the desired algorithm requires a newer version
  3. Remove the compression property to use Kudu defaults

Example fix

// before
compression = 'zstd'
// after
compression = 'lz4'
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("lz4","snappy","zlib");
if (compression != null && !allowed.contains(compression.toLowerCase(Locale.ENGLISH))) {
    throw new IllegalArgumentException("Unsupported compression: " + compression);
}

Try / catch

try {
    createTable(...);
} catch (PrestoException e) {
    if (e.getMessage().contains("Unknown compression algorithm")) {
        throw new IllegalArgumentException("Use lz4, snappy, or zlib: " + e.getMessage(), e);
    }
    throw e;
}

Prevention

When it happens

Trigger: CREATE TABLE with a column compression property value Kudu does not recognize (e.g. 'brotli', 'zstd' on a Kudu version lacking it, or a typo like 'snappy2').

Common situations: Copying compression settings from other engines; Kudu version differences in supported algorithms; typos in compression property.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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