Skip to content
This repository has been archived by the owner on Dec 21, 2018. It is now read-only.

Commit

Permalink
[binary-operators-draft]: udpate get_column_byte_width to support uns…
Browse files Browse the repository at this point in the history
…igned types
  • Loading branch information
aocsa committed Oct 24, 2018
1 parent 3a74ff8 commit f7c3d4f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/gdf/cffi/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ typedef enum {
GDF_INT16,
GDF_INT32,
GDF_INT64,
GDF_UINT8,
GDF_UINT16,
GDF_UINT32,
GDF_UINT64,
GDF_FLOAT32,
GDF_FLOAT64,
GDF_DATE32, /**< int32_t days since the UNIX epoch */
GDF_DATE64, /**< int64_t milliseconds since the UNIX epoch */
GDF_TIMESTAMP, /**< Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */
GDF_CATEGORY,
GDF_STRING,
GDF_UINT8,

This comment has been minimized.

Copy link
@jrhemstad

jrhemstad Oct 24, 2018

Contributor

My feeling is that these new types should be added in their own PR because a lot of code will need to be updated to accommodate these additional types.

GDF_UINT16,
GDF_UINT32,
GDF_UINT64,
N_GDF_TYPES, /* additional types should go BEFORE N_GDF_TYPES */
} gdf_dtype;

Expand Down
12 changes: 12 additions & 0 deletions src/column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ gdf_error get_column_byte_width(gdf_column * col, int * width){
case GDF_TIMESTAMP :
*width = 8;
break;
case GDF_UINT8 :
*width = 1;
break;
case GDF_UINT16:
*width = 2;
break;
case GDF_UINT32:
*width = 4;
break;
case GDF_UINT64:
*width = 8;
break;
default :
*width = -1;
return GDF_UNSUPPORTED_DTYPE;
Expand Down

0 comments on commit f7c3d4f

Please sign in to comment.