prestodb/presto · error · ZipException

The requested unsigned long value is too large for Java's si

Error message

The requested unsigned long value is too large for Java's signed values. This Zip file is unsupported

What it means

getUnsignedLong reads 8 bytes as an unsigned 64-bit value, but Java longs are signed; when the raw value exceeds Long.MAX_VALUE it cannot be represented, so this ZipException rejects the unsupported zip file.

Source

Thrown at presto-druid/src/main/java/com/facebook/presto/druid/zip/ZipUtil.java:142

        return (h << 56) | (g << 48) | (f << 40) | (e << 32) | (d << 24) | (c << 16) | (b << 8) | a;
    }

    public static int getUnsignedShort(byte[] source, int offset)
    {
        return get16(source, offset) & 0xffff;
    }

    public static long getUnsignedInt(byte[] source, int offset)
    {
        return get32(source, offset) & 0xffffffffL;
    }

    public static long getUnsignedLong(byte[] source, int offset)
            throws ZipException
    {
        long result = get64(source, offset);
        if (result < 0) {
            throw new ZipException("The requested unsigned long value is too large for Java's signed "
                    + "values. This Zip file is unsupported");
        }
        return result;
    }

    /**
     * Checks if the unix timestamp is representable as a valid DOS timestamp.
     *
     * <p>See <a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">ZIP Format</a> for
     * a general description of the date a time fields (Section 4.4.6) and
     * <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms724247.aspx">DOS date
     * format</a> for a detailed description of the format.
     */
    public static boolean isValidInDos(long timeMillis)
    {
        Calendar time = Calendar.getInstance();
        time.setTimeInMillis(timeMillis);
        Calendar minTime = Calendar.getInstance();

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Reject or regenerate the ZIP data producing the oversized unsigned value
  2. Use ZIP64-aware handling where supported
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-druid/src/main/java/com/facebook/presto/druid/zip/ZipUtil.java:142 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/2b1d2f4dac80e76f. Report an issue: GitHub.