|
91 | 91 | import tech.ydb.table.values.ListValue;
|
92 | 92 | import tech.ydb.table.values.StructValue;
|
93 | 93 | import tech.ydb.table.values.TupleValue;
|
| 94 | +import tech.ydb.table.values.Type; |
94 | 95 | import tech.ydb.table.values.Value;
|
95 | 96 | import tech.ydb.table.values.proto.ProtoType;
|
96 | 97 | import tech.ydb.table.values.proto.ProtoValue;
|
@@ -208,6 +209,9 @@ private static YdbTable.ColumnMeta buildColumnMeta(TableColumn column) {
|
208 | 209 | if (column.getFamily() != null) {
|
209 | 210 | builder.setFamily(column.getFamily());
|
210 | 211 | }
|
| 212 | + if (column.getType().getKind() != Type.Kind.OPTIONAL) { |
| 213 | + builder.setNotNull(true); |
| 214 | + } |
211 | 215 | return builder.build();
|
212 | 216 | }
|
213 | 217 |
|
@@ -362,6 +366,17 @@ public CompletableFuture<Status> createTable(
|
362 | 366 | .setOperationParams(Operation.buildParams(settings.toOperationSettings()))
|
363 | 367 | .addAllPrimaryKey(description.getPrimaryKeys());
|
364 | 368 |
|
| 369 | + switch (description.getStoreType()) { |
| 370 | + case ROW: |
| 371 | + request.setStoreType(YdbTable.StoreType.STORE_TYPE_ROW); |
| 372 | + break; |
| 373 | + case COLUMN: |
| 374 | + request.setStoreType(YdbTable.StoreType.STORE_TYPE_COLUMN); |
| 375 | + break; |
| 376 | + default: |
| 377 | + break; |
| 378 | + } |
| 379 | + |
365 | 380 | for (ColumnFamily family: description.getColumnFamilies()) {
|
366 | 381 | request.addColumnFamilies(buildColumnFamity(family));
|
367 | 382 | }
|
@@ -726,6 +741,19 @@ private static TableDescription mapDescribeTable(
|
726 | 741 | DescribeTableSettings describeTableSettings
|
727 | 742 | ) {
|
728 | 743 | TableDescription.Builder description = TableDescription.newBuilder();
|
| 744 | + switch (result.getStoreType()) { |
| 745 | + case STORE_TYPE_ROW: |
| 746 | + description = description.setStoreType(TableDescription.StoreType.ROW); |
| 747 | + break; |
| 748 | + case STORE_TYPE_COLUMN: |
| 749 | + description = description.setStoreType(TableDescription.StoreType.COLUMN); |
| 750 | + break; |
| 751 | + case UNRECOGNIZED: |
| 752 | + case STORE_TYPE_UNSPECIFIED: |
| 753 | + default: |
| 754 | + break; |
| 755 | + } |
| 756 | + |
729 | 757 | for (int i = 0; i < result.getColumnsCount(); i++) {
|
730 | 758 | YdbTable.ColumnMeta column = result.getColumns(i);
|
731 | 759 | description.addNonnullColumn(column.getName(), ProtoType.fromPb(column.getType()), column.getFamily());
|
|
0 commit comments