Jean-Daniel Cryans has submitted this change and it was merged.

Change subject: [java] KUDU-1746/KUDU-1747 Improve addColumn API
......................................................................


[java] KUDU-1746/KUDU-1747 Improve addColumn API

Previously, the java client permitted adding

- a non-null column with a default
- a nullable column with no default

but did not allow adding

- a nullable column with a default

even though it should be allowed. This patch adds that capability
by adding a 'defaultVal' argument to an overloaded
AlterTableOptions.addNullableColumn.

It also adds a more general method to add a column based on a
ColumnSchema. This more advanced API should be easier to maintain
as more column options are added to Kudu. The other addColumn
variants are reimplemented in terms of this one.

Previous methods remain for backward-compatibility.

Additionally, a test was added to check behavior of the three
addColumn possibilities (which tests the new addColumn(ColumnSchema)
since they are implemented using it).

Finally, I fixed a checkstyle warning in AsyncKuduScanner.

Change-Id: I0706839a3dbe21532afd524e2d3fc020d31a9973
Reviewed-on: http://gerrit.cloudera.org:8080/5132
Tested-by: Kudu Jenkins
Reviewed-by: Jean-Daniel Cryans <[email protected]>
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestAlterTable.java
3 files changed, 86 insertions(+), 21 deletions(-)

Approvals:
  Jean-Daniel Cryans: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/5132
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0706839a3dbe21532afd524e2d3fc020d31a9973
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Will Berkeley <[email protected]>
Gerrit-Reviewer: Dimitris Tsirogiannis <[email protected]>
Gerrit-Reviewer: Jean-Daniel Cryans <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Will Berkeley <[email protected]>

Reply via email to