This is an automated email from the ASF dual-hosted git repository.
dkuzmenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new c80c7215f03 HIVE-29431: Avoid "RuntimeException: invalid table size"
for DESCRIBE FORMATTED when stats are missing (#6289)
c80c7215f03 is described below
commit c80c7215f032cd49d79e15275520bf55d768a901
Author: Thomas Rebele <[email protected]>
AuthorDate: Wed Feb 4 10:40:30 2026 +0100
HIVE-29431: Avoid "RuntimeException: invalid table size" for DESCRIBE
FORMATTED when stats are missing (#6289)
---
ql/src/java/org/apache/hadoop/hive/ql/ddl/ShowUtils.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/ddl/ShowUtils.java
b/ql/src/java/org/apache/hadoop/hive/ql/ddl/ShowUtils.java
index 8d731e5bd72..01f6a07a1a4 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/ddl/ShowUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/ddl/ShowUtils.java
@@ -474,12 +474,16 @@ public void transpose() {
newTable.add(new ArrayList<>());
}
for (List<String> sourceRow : table) {
- if (newTable.size() != sourceRow.size()) {
+ if (newTable.size() < sourceRow.size()) {
throw new RuntimeException("invalid table size");
}
for (int i = 0; i < sourceRow.size(); i++) {
newTable.get(i).add(sourceRow.get(i));
}
+ // if a source row is too short, pad the output column with empty
strings
+ for (int i = sourceRow.size(); i < newTable.size(); i++) {
+ newTable.get(i).add("");
+ }
}
table = newTable;
}