prestodb/presto · warning · PrestoException
INVALID_ANALYZE_PROPERTY
INVALID_ANALYZE_PROPERTY
Error message
Invalid null value in analyze partitions property
What it means
HiveAnalyzeProperties.throwIfNull rejects a null value supplied for a property in ANALYZE TABLE ... PROPERTIES(...). ANALYZE properties (e.g. the partitions list) map property values through parsing functions that must not produce null; a null means the user passed an invalid literal (e.g. NULL) for a property expecting a concrete value.
Source
Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveAnalyzeProperties.java:85
private static List<List<String>> decodePartitionLists(Object object)
{
if (object == null) {
return null;
}
// replace null partition value with hive default partition
return ImmutableList.copyOf(((Collection<?>) object).stream()
.peek(HiveAnalyzeProperties::throwIfNull)
.map(partition -> ((Collection<?>) partition).stream()
.map(name -> firstNonNull((String) name, HIVE_DEFAULT_DYNAMIC_PARTITION))
.collect(toImmutableList()))
.collect(toImmutableSet()));
}
private static void throwIfNull(Object object)
{
if (object == null) {
throw new PrestoException(INVALID_ANALYZE_PROPERTY, "Invalid null value in analyze partitions property");
}
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Replace the NULL property value with a valid literal, e.g. partitions = ARRAY['2024-01-01'].
- If the value comes from a variable or template, guard for null and either skip the property or substitute a correct partition list.
- To analyze all partitions, omit the partitions property entirely rather than passing null.
Example fix
// before ANALYZE TABLE orders WITH (partitions = NULL); // after ANALYZE TABLE orders WITH (partitions = ARRAY['2024-01-01', '2024-01-02']);
Defensive patterns
Strategy: validation
Validate before calling
// validate analyze properties before issuing the statement
if (partitionsProp == null) {
throw new IllegalArgumentException("partitions property must be a non-null array literal; omit it to analyze all partitions");
} Try / catch
try {
session.execute(analyzeSql);
} catch (PrestoException e) {
if (INVALID_ANALYZE_PROPERTY.toErrorCode().equals(e.getErrorCode())) {
throw new IllegalArgumentException("Fix ANALYZE properties: " + e.getMessage());
}
throw e;
} Prevention
- Never template NULL into ANALYZE properties; omit optional properties instead.
- Use non-null partition value arrays when generating ANALYZE programmatically.
- Add pre-execution SQL linting for ANALYZE statements.
When it happens
Trigger: Running ANALYZE TABLE ... WITH (partitions = ...) (or another analyze property) where the supplied value is SQL NULL or parses to null — throwIfNull fires with INVALID_ANALYZE_PROPERTY.
Common situations: Hand-written ANALYZE statements that pass NULL instead of an array of partition values; programmatically generated ANALYZE queries where the partition list variable is null/unset; scripts templating properties with missing values.
Related errors
- A null map must have zero entries
- slice is null
- Expected field to be %s, actual %s (field %s)
- HIVE_FILESYSTEM_ERROR
- GENERIC_INTERNAL_ERROR
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/758c5e0bbddce04b.
Report an issue: GitHub.