From 35717e490b495481e4a69dccd548a15dbe2a75f1 Mon Sep 17 00:00:00 2001 From: Khee-Chin Chua Date: Mon, 18 Nov 2024 01:49:50 +0800 Subject: [PATCH] [Enhancement] Improve error message to return table information and partition column names --- .../sql/optimizer/rewrite/OptExternalPartitionPruner.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rewrite/OptExternalPartitionPruner.java b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rewrite/OptExternalPartitionPruner.java index 11d2bc289054c..f0baa4e542926 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rewrite/OptExternalPartitionPruner.java +++ b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rewrite/OptExternalPartitionPruner.java @@ -313,7 +313,10 @@ private static void initPartitionInfo(LogicalScanOperator operator, OptimizerCon LOG.warn("Partition pruning is invalid. queryId: {}", DebugUtil.printId(context.getQueryId())); throw new AnalysisException("Partition pruning is invalid, please check: " + "1. The partition predicate must be included. " - + "2. The left and right children of the partition predicate cannot be function parameters."); + + "2. The left and right children of the partition predicate cannot be function parameters. " + + "Table: " + hmsTable.getCatalogName() + "." + hmsTable.getDbName() + + "." + hmsTable.getTableName() + " " + "Partition columns: " + + partitionColumns.stream().map(Column::getName).collect(Collectors.joining(", "))); } // get partition names