File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
test/java/tech/ydb/table/integration Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ public static class Builder {
128
128
private TableTtl ttlSettings = TableTtl .notSet ();
129
129
private final List <ChangefeedDescription > changefeeds = new ArrayList <>();
130
130
131
- public Builder withStoreType (StoreType storeType ) {
131
+ public Builder setStoreType (StoreType storeType ) {
132
132
this .storeType = storeType ;
133
133
return this ;
134
134
}
Original file line number Diff line number Diff line change 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
@@ -739,10 +743,10 @@ private static TableDescription mapDescribeTable(
739
743
TableDescription .Builder description = TableDescription .newBuilder ();
740
744
switch (result .getStoreType ()) {
741
745
case STORE_TYPE_ROW :
742
- description = description .withStoreType (TableDescription .StoreType .ROWS );
746
+ description = description .setStoreType (TableDescription .StoreType .ROWS );
743
747
break ;
744
748
case STORE_TYPE_COLUMN :
745
- description = description .withStoreType (TableDescription .StoreType .COLUMNS );
749
+ description = description .setStoreType (TableDescription .StoreType .COLUMNS );
746
750
break ;
747
751
case UNRECOGNIZED :
748
752
case STORE_TYPE_UNSPECIFIED :
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ public void alterTableTest() {
74
74
75
75
TableDescription description = describeResult .getValue ();
76
76
77
+ Assert .assertEquals (TableDescription .StoreType .ROWS , description .getStoreType ());
77
78
Assert .assertEquals (1 , description .getColumnFamilies ().size ());
78
79
Assert .assertEquals (DEFAULT_FAMILY , description .getColumnFamilies ().get (0 ).getName ());
79
80
Original file line number Diff line number Diff line change 1
1
package tech .ydb .table .integration ;
2
2
3
3
import java .util .Arrays ;
4
+
4
5
import org .junit .Assert ;
5
6
import org .junit .ClassRule ;
6
7
import org .junit .Test ;
8
+
7
9
import tech .ydb .core .Result ;
8
10
import tech .ydb .core .Status ;
9
-
10
11
import tech .ydb .table .SessionRetryContext ;
11
12
import tech .ydb .table .description .TableColumn ;
12
13
import tech .ydb .table .description .TableDescription ;
@@ -53,8 +54,8 @@ public class RenameTablesTest {
53
54
public void testRenameTables () {
54
55
TableDescription tableDescription = TableDescription .newBuilder ()
55
56
.addNullableColumn ("id" , PrimitiveType .Uint64 )
56
- .addNullableColumn ("code" , PrimitiveType .Text )
57
- .addNullableColumn ("size" , PrimitiveType .Float )
57
+ .addNonnullColumn ("code" , PrimitiveType .Text )
58
+ .addNonnullColumn ("size" , PrimitiveType .Float )
58
59
.addNullableColumn ("created" , PrimitiveType .Timestamp )
59
60
.addNullableColumn ("data" , PrimitiveType .Json )
60
61
.setPrimaryKey ("id" )
You can’t perform that action at this time.
0 commit comments