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 {
128128 private TableTtl ttlSettings = TableTtl .notSet ();
129129 private final List <ChangefeedDescription > changefeeds = new ArrayList <>();
130130
131- public Builder withStoreType (StoreType storeType ) {
131+ public Builder setStoreType (StoreType storeType ) {
132132 this .storeType = storeType ;
133133 return this ;
134134 }
Original file line number Diff line number Diff line change 9191import tech .ydb .table .values .ListValue ;
9292import tech .ydb .table .values .StructValue ;
9393import tech .ydb .table .values .TupleValue ;
94+ import tech .ydb .table .values .Type ;
9495import tech .ydb .table .values .Value ;
9596import tech .ydb .table .values .proto .ProtoType ;
9697import tech .ydb .table .values .proto .ProtoValue ;
@@ -208,6 +209,9 @@ private static YdbTable.ColumnMeta buildColumnMeta(TableColumn column) {
208209 if (column .getFamily () != null ) {
209210 builder .setFamily (column .getFamily ());
210211 }
212+ if (column .getType ().getKind () != Type .Kind .OPTIONAL ) {
213+ builder .setNotNull (true );
214+ }
211215 return builder .build ();
212216 }
213217
@@ -739,10 +743,10 @@ private static TableDescription mapDescribeTable(
739743 TableDescription .Builder description = TableDescription .newBuilder ();
740744 switch (result .getStoreType ()) {
741745 case STORE_TYPE_ROW :
742- description = description .withStoreType (TableDescription .StoreType .ROWS );
746+ description = description .setStoreType (TableDescription .StoreType .ROWS );
743747 break ;
744748 case STORE_TYPE_COLUMN :
745- description = description .withStoreType (TableDescription .StoreType .COLUMNS );
749+ description = description .setStoreType (TableDescription .StoreType .COLUMNS );
746750 break ;
747751 case UNRECOGNIZED :
748752 case STORE_TYPE_UNSPECIFIED :
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ public void alterTableTest() {
7474
7575 TableDescription description = describeResult .getValue ();
7676
77+ Assert .assertEquals (TableDescription .StoreType .ROWS , description .getStoreType ());
7778 Assert .assertEquals (1 , description .getColumnFamilies ().size ());
7879 Assert .assertEquals (DEFAULT_FAMILY , description .getColumnFamilies ().get (0 ).getName ());
7980
Original file line number Diff line number Diff line change 11package tech .ydb .table .integration ;
22
33import java .util .Arrays ;
4+
45import org .junit .Assert ;
56import org .junit .ClassRule ;
67import org .junit .Test ;
8+
79import tech .ydb .core .Result ;
810import tech .ydb .core .Status ;
9-
1011import tech .ydb .table .SessionRetryContext ;
1112import tech .ydb .table .description .TableColumn ;
1213import tech .ydb .table .description .TableDescription ;
@@ -53,8 +54,8 @@ public class RenameTablesTest {
5354 public void testRenameTables () {
5455 TableDescription tableDescription = TableDescription .newBuilder ()
5556 .addNullableColumn ("id" , PrimitiveType .Uint64 )
56- .addNullableColumn ("code" , PrimitiveType .Text )
57- .addNullableColumn ("size" , PrimitiveType .Float )
57+ .addNonnullColumn ("code" , PrimitiveType .Text )
58+ .addNonnullColumn ("size" , PrimitiveType .Float )
5859 .addNullableColumn ("created" , PrimitiveType .Timestamp )
5960 .addNullableColumn ("data" , PrimitiveType .Json )
6061 .setPrimaryKey ("id" )
You can’t perform that action at this time.
0 commit comments