Skip to content

Commit 17d46da

Browse files
adding support for the enumerated datatype
1 parent 30c3ede commit 17d46da

File tree

10 files changed

+488
-1
lines changed

10 files changed

+488
-1
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ TILEDB_S3=ON
55
TILEDB_AZURE=OFF
66
TILEDB_HDFS=OFF
77
TILEDB_SERIALIZATION=OFF
8-
FORCE_BUILD_TILEDB=ON
8+
FORCE_BUILD_TILEDB=OFF
99
DOWNLOAD_TILEDB_PREBUILT=ON
1010
TILEDB_SKIP_S3AWSSDK_DIR_LENGTH_CHECK=ON

src/main/c/generated/tiledb_wrap.cxx

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,27 @@ static tiledb_string_handle_t* tiledb_string_handle_tpp_value(tiledb_string_hand
14701470
}
14711471

14721472

1473+
static tiledb_enumeration_t* *new_tiledb_enumeration_tpp() {
1474+
return new tiledb_enumeration_t*();
1475+
}
1476+
1477+
static tiledb_enumeration_t* *copy_tiledb_enumeration_tpp(tiledb_enumeration_t* value) {
1478+
return new tiledb_enumeration_t*(value);
1479+
}
1480+
1481+
static void delete_tiledb_enumeration_tpp(tiledb_enumeration_t* *obj) {
1482+
if (obj) delete obj;
1483+
}
1484+
1485+
static void tiledb_enumeration_tpp_assign(tiledb_enumeration_t* *obj, tiledb_enumeration_t* value) {
1486+
*obj = value;
1487+
}
1488+
1489+
static tiledb_enumeration_t* tiledb_enumeration_tpp_value(tiledb_enumeration_t* *obj) {
1490+
return *obj;
1491+
}
1492+
1493+
14731494
static tiledb_array_schema_evolution_t* *new_tiledb_array_schema_evolution_tpp() {
14741495
return new tiledb_array_schema_evolution_t*();
14751496
}
@@ -5552,6 +5573,68 @@ SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1string_1hand
55525573
}
55535574

55545575

5576+
SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_new_1tiledb_1enumeration_1tpp(JNIEnv *jenv, jclass jcls) {
5577+
jlong jresult = 0 ;
5578+
tiledb_enumeration_t **result = 0 ;
5579+
5580+
(void)jenv;
5581+
(void)jcls;
5582+
result = (tiledb_enumeration_t **)new_tiledb_enumeration_tpp();
5583+
*(tiledb_enumeration_t ***)&jresult = result;
5584+
return jresult;
5585+
}
5586+
5587+
5588+
SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_copy_1tiledb_1enumeration_1tpp(JNIEnv *jenv, jclass jcls, jlong jarg1) {
5589+
jlong jresult = 0 ;
5590+
tiledb_enumeration_t *arg1 = (tiledb_enumeration_t *) 0 ;
5591+
tiledb_enumeration_t **result = 0 ;
5592+
5593+
(void)jenv;
5594+
(void)jcls;
5595+
arg1 = *(tiledb_enumeration_t **)&jarg1;
5596+
result = (tiledb_enumeration_t **)copy_tiledb_enumeration_tpp(arg1);
5597+
*(tiledb_enumeration_t ***)&jresult = result;
5598+
return jresult;
5599+
}
5600+
5601+
5602+
SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_delete_1tiledb_1enumeration_1tpp(JNIEnv *jenv, jclass jcls, jlong jarg1) {
5603+
tiledb_enumeration_t **arg1 = (tiledb_enumeration_t **) 0 ;
5604+
5605+
(void)jenv;
5606+
(void)jcls;
5607+
arg1 = *(tiledb_enumeration_t ***)&jarg1;
5608+
delete_tiledb_enumeration_tpp(arg1);
5609+
}
5610+
5611+
5612+
SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1enumeration_1tpp_1assign(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
5613+
tiledb_enumeration_t **arg1 = (tiledb_enumeration_t **) 0 ;
5614+
tiledb_enumeration_t *arg2 = (tiledb_enumeration_t *) 0 ;
5615+
5616+
(void)jenv;
5617+
(void)jcls;
5618+
arg1 = *(tiledb_enumeration_t ***)&jarg1;
5619+
arg2 = *(tiledb_enumeration_t **)&jarg2;
5620+
tiledb_enumeration_tpp_assign(arg1,arg2);
5621+
}
5622+
5623+
5624+
SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1enumeration_1tpp_1value(JNIEnv *jenv, jclass jcls, jlong jarg1) {
5625+
jlong jresult = 0 ;
5626+
tiledb_enumeration_t **arg1 = (tiledb_enumeration_t **) 0 ;
5627+
tiledb_enumeration_t *result = 0 ;
5628+
5629+
(void)jenv;
5630+
(void)jcls;
5631+
arg1 = *(tiledb_enumeration_t ***)&jarg1;
5632+
result = (tiledb_enumeration_t *)tiledb_enumeration_tpp_value(arg1);
5633+
*(tiledb_enumeration_t **)&jresult = result;
5634+
return jresult;
5635+
}
5636+
5637+
55555638
SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_new_1tiledb_1array_1schema_1evolution_1tpp(JNIEnv *jenv, jclass jcls) {
55565639
jlong jresult = 0 ;
55575640
tiledb_array_schema_evolution_t **result = 0 ;
@@ -6513,6 +6596,30 @@ SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1string_1free
65136596
}
65146597

65156598

6599+
SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_sys_1nerr_1get(JNIEnv *jenv, jclass jcls) {
6600+
jint jresult = 0 ;
6601+
int result;
6602+
6603+
(void)jenv;
6604+
(void)jcls;
6605+
result = (int)(int)sys_nerr;
6606+
jresult = (jint)result;
6607+
return jresult;
6608+
}
6609+
6610+
6611+
SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_sys_1errlist_1get(JNIEnv *jenv, jclass jcls) {
6612+
jlong jresult = 0 ;
6613+
char **result = 0 ;
6614+
6615+
(void)jenv;
6616+
(void)jcls;
6617+
result = (char **)(char **)sys_errlist;
6618+
*(char ***)&jresult = result;
6619+
return jresult;
6620+
}
6621+
6622+
65166623
SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1attribute_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3, jlong jarg4) {
65176624
jint jresult = 0 ;
65186625
tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ;

src/main/java/io/tiledb/java/api/Array.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,27 @@ public Pair<BigInteger, BigInteger> getNonEmptyDomainVarSizeFromIndex(long index
522522
return new Pair(tiledb.ullp_value(startSize), tiledb.ullp_value(endSize));
523523
}
524524

525+
/**
526+
* Retrieves an enumeration given the name (key)
527+
*
528+
* @param name The Enumeration name
529+
* @return The Enumeration
530+
* @throws TileDBError
531+
*/
532+
public Enumeration getEnumeration(String name) throws TileDBError {
533+
Enumeration _enumeration;
534+
SWIGTYPE_p_p_tiledb_enumeration_t enumerationpp = tiledb.new_tiledb_enumeration_tpp();
535+
try {
536+
ctx.handleError(
537+
tiledb.tiledb_array_get_enumeration(ctx.getCtxp(), getArrayp(), name, enumerationpp));
538+
_enumeration = new Enumeration(ctx, enumerationpp);
539+
} catch (TileDBError err) {
540+
tiledb.delete_tiledb_enumeration_tpp(enumerationpp);
541+
throw err;
542+
}
543+
return _enumeration;
544+
}
545+
525546
/**
526547
* Retrieves the non-empty domain range sizes from an array for a given dimension name. This is
527548
* the union of the non-empty domains of the array fragments on the given dimension. Applicable

src/main/java/io/tiledb/java/api/ArraySchema.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,18 @@ public boolean hasDimensionLabel(String name) throws TileDBError {
734734
return result;
735735
}
736736

737+
/**
738+
* Add an enumeration to the array schema.
739+
*
740+
* @param enumeration The enumeration to add
741+
* @throws TileDBError
742+
*/
743+
public void addEnumeration(Enumeration enumeration) throws TileDBError {
744+
ctx.handleError(
745+
tiledb.tiledb_array_schema_add_enumeration(
746+
ctx.getCtxp(), getSchemap(), enumeration.getEnumerationp()));
747+
}
748+
737749
/**
738750
* Returns the array schema version.
739751
*

src/main/java/io/tiledb/java/api/ArraySchemaEvolution.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,30 @@ public void setTimeStampRange(BigInteger high, BigInteger low) throws TileDBErro
124124
}
125125
}
126126

127+
/**
128+
* Adds an enumeration to an array schema evolution
129+
*
130+
* @param e The enumeration to be added
131+
* @throws TileDBError
132+
*/
133+
public void addEnumeration(Enumeration e) throws TileDBError {
134+
ctx.handleError(
135+
tiledb.tiledb_array_schema_evolution_add_enumeration(
136+
ctx.getCtxp(), getEvolutionp(), e.getEnumerationp()));
137+
}
138+
139+
/**
140+
* Drops an enumeration from an array schema evolution.
141+
*
142+
* @param name The name of the enumeration to be dropped
143+
* @throws TileDBError
144+
*/
145+
public void dropEnumeration(String name) throws TileDBError {
146+
ctx.handleError(
147+
tiledb.tiledb_array_schema_evolution_drop_enumeration(
148+
ctx.getCtxp(), getEvolutionp(), name));
149+
}
150+
127151
/**
128152
* Evolves the schema of an array.
129153
*

0 commit comments

Comments
 (0)