25
25
package io .tiledb .java .api ;
26
26
27
27
import static io .tiledb .java .api .ArrayType .*;
28
+ import static io .tiledb .java .api .Datatype .TILEDB_FLOAT32 ;
29
+ import static io .tiledb .java .api .Datatype .TILEDB_INT32 ;
28
30
import static io .tiledb .java .api .Datatype .TILEDB_UINT8 ;
29
31
import static io .tiledb .java .api .Layout .*;
30
32
import static io .tiledb .java .api .QueryType .*;
@@ -114,9 +116,9 @@ public void arrayCreate() throws Exception {
114
116
domain .addDimension (d2 );
115
117
116
118
// Create and add getAttributes
117
- Attribute a1 = new Attribute (ctx , "a1" , Integer . class );
119
+ Attribute a1 = new Attribute (ctx , "a1" , TILEDB_INT32 );
118
120
a1 .setNullable (true );
119
- Attribute a2 = new Attribute (ctx , "a2" , Float . class );
121
+ Attribute a2 = new Attribute (ctx , "a2" , TILEDB_FLOAT32 );
120
122
121
123
ArraySchema schema = new ArraySchema (ctx , TILEDB_DENSE );
122
124
schema .setTileOrder (TILEDB_ROW_MAJOR );
@@ -136,13 +138,13 @@ public void arrayWrite() throws Exception {
136
138
137
139
// Prepare cell buffers
138
140
NativeArray a1_data =
139
- new NativeArray (ctx , new int [] {8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 }, Integer . class );
141
+ new NativeArray (ctx , new int [] {8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 }, TILEDB_INT32 );
140
142
141
143
NativeArray buffer_a2 =
142
144
new NativeArray (
143
145
ctx ,
144
146
new float [] {13.2f , 14.1f , 14.2f , 15.1f , 15.2f , 15.3f , 16.1f , 18.3f , 19.1f },
145
- Float . class );
147
+ TILEDB_FLOAT32 );
146
148
147
149
// Create query
148
150
NativeArray a1Bytemap =
@@ -176,15 +178,15 @@ private void arrayRead() throws Exception {
176
178
max_sizes .put ("a2" , new Pair <>(0L , query .getEstResultSize (ctx , "a2" )));
177
179
query .setBufferNullable (
178
180
"a1" ,
179
- new NativeArray (ctx , max_sizes .get ("a1" ).getSecond ().intValue (), Integer . class ),
181
+ new NativeArray (ctx , max_sizes .get ("a1" ).getSecond ().intValue (), TILEDB_INT32 ),
180
182
new NativeArray (ctx , 16 , TILEDB_UINT8 ));
181
183
query .setBuffer (
182
184
"a2" , new NativeArray (ctx , max_sizes .get ("a2" ).getSecond ().intValue (), Float .class ));
183
185
// null + normal + combined condition test
184
- QueryCondition con1 = new QueryCondition (ctx , "a2" , 15.0f , Float . class , TILEDB_GT );
185
- QueryCondition con2 = new QueryCondition (ctx , "a1" , 0 , null , TILEDB_EQ );
186
+ QueryCondition con1 = new QueryCondition (ctx , "a2" , TILEDB_FLOAT32 , 15.0f , TILEDB_GT );
187
+ QueryCondition con2 = new QueryCondition (ctx , "a1" , null , 0 , TILEDB_EQ );
186
188
QueryCondition con3 = con1 .combine (con2 , TILEDB_AND );
187
- QueryCondition con4 = new QueryCondition (ctx , "a1" , 9 , Integer . class , TILEDB_EQ );
189
+ QueryCondition con4 = new QueryCondition (ctx , "a1" , TILEDB_INT32 , 9 , TILEDB_EQ );
188
190
QueryCondition con5 = con4 .combine (con3 , TILEDB_OR );
189
191
query .setCondition (con5 );
190
192
@@ -237,7 +239,7 @@ public void testDataDeletion() throws TileDBError {
237
239
// delete data with appropriate QC
238
240
Array array = new Array (ctx , arrayURISparse , TILEDB_DELETE );
239
241
Query query = new Query (array , TILEDB_DELETE );
240
- QueryCondition deleteQc = new QueryCondition (ctx , "a1" , 3 , Integer . class , TILEDB_GT );
242
+ QueryCondition deleteQc = new QueryCondition (ctx , "a1" , TILEDB_INT32 , 3 , TILEDB_GT );
241
243
query .setCondition (deleteQc );
242
244
query .submit ();
243
245
// close resources
0 commit comments