You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by da...@apache.org on 2016/05/31 17:16:30 UTC
[2/2] incubator-kudu git commit: KUDU-1470 Exceptions on getting a
column value should return the column name not the column number
KUDU-1470 Exceptions on getting a column value should return the column name not the column number
Change-Id: Ie8bb3db1ed7b4e2027814815776f6252b0f749c5
Reviewed-on: http://gerrit.cloudera.org:8080/3231
Reviewed-by: Dan Burkert <da...@cloudera.com>
Tested-by: Kudu Jenkins
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/cc658cac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/cc658cac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/cc658cac
Branch: refs/heads/master
Commit: cc658cac1b8be86a18839ea5c7a89c1a768c8516
Parents: 71420f0
Author: tmalaska <te...@cloudera.com>
Authored: Thu May 26 20:47:08 2016 -0400
Committer: Dan Burkert <da...@cloudera.com>
Committed: Tue May 31 17:16:01 2016 +0000
----------------------------------------------------------------------
.../src/main/java/org/kududb/client/RowResult.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/cc658cac/java/kudu-client/src/main/java/org/kududb/client/RowResult.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/kududb/client/RowResult.java b/java/kudu-client/src/main/java/org/kududb/client/RowResult.java
index e0c09ae..7692c53 100644
--- a/java/kudu-client/src/main/java/org/kududb/client/RowResult.java
+++ b/java/kudu-client/src/main/java/org/kududb/client/RowResult.java
@@ -480,7 +480,9 @@ public class RowResult {
return;
}
if (isNull(columnIndex)) {
- throw new IllegalArgumentException("The requested column (" + columnIndex + ") is null");
+ ColumnSchema columnSchema = schema.getColumnByIndex(columnIndex);
+ throw new IllegalArgumentException("The requested column (name: " + columnSchema.getName() +
+ ", index: " + columnIndex + ") is null");
}
}
@@ -488,8 +490,9 @@ public class RowResult {
ColumnSchema columnSchema = schema.getColumnByIndex(columnIndex);
Type columnType = columnSchema.getType();
if (!columnType.equals(expectedType)) {
- throw new IllegalArgumentException("Column (" + columnIndex + ") is of type " +
- columnType.getName() + " but was requested as a type " + expectedType.getName());
+ throw new IllegalArgumentException("Column (name: " + columnSchema.getName() +
+ ", index: " + columnIndex +") is of type " +
+ columnType.getName() + " but was requested as a type " + expectedType.getName());
}
}