Skip to content

Commit

Permalink
Binary type implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ooke committed Nov 7, 2023
1 parent da0c1ae commit 06cbbea
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions exaudfclient/base/exaudflib/exascript.i
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ enum SWIGVM_datatype_e {
TIMESTAMP = 5,
DATE = 6,
STRING = 7,
BINARY = 12,
BOOLEAN = 8 };

enum SWIGVM_itertype_e {
Expand Down
8 changes: 8 additions & 0 deletions exaudfclient/base/exaudflib/impl/socket_high_level.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ bool exaudflib::socket_high_level::send_init(zmq::socket_t &socket, const std::s
coltype.type = SWIGVMContainers::STRING;
coltype.len = coldef.size();
break;
case PB_BINARY:
coltype.type = SWIGVMContainers::BINARY;
coltype.len = coldef.size();
break;
case PB_BOOLEAN:
coltype.type = SWIGVMContainers::BOOLEAN;
break;
Expand Down Expand Up @@ -228,6 +232,10 @@ bool exaudflib::socket_high_level::send_init(zmq::socket_t &socket, const std::s
coltype.type = SWIGVMContainers::STRING;
coltype.len = coldef.size();
break;
case PB_BINARY:
coltype.type = SWIGVMContainers::BINARY;
coltype.len = coldef.size();
break;
case PB_BOOLEAN:
coltype.type = SWIGVMContainers::BOOLEAN;
break;
Expand Down
4 changes: 2 additions & 2 deletions exaudfclient/base/exaudflib/impl/swig/swig_table_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SWIGTableIterator_Impl : public AbstractSWIGTableIterator, SWIGGeneralIter
case TIMESTAMP:
case DATE:
case STRING: m_col_offsets[current_column] = m_values_per_row.strings++; break;
case HASHTYPE: m_col_offsets[current_column] = m_values_per_row.binaries++; break;
case BINARY: m_col_offsets[current_column] = m_values_per_row.binaries++; break;
case BOOLEAN: m_col_offsets[current_column] = m_values_per_row.bools++; break;
default: m_exch->setException("F-UDF-CL-LIB-1058: Unknown data type found, got "+it->type); return;
}
Expand Down Expand Up @@ -249,7 +249,7 @@ class SWIGTableIterator_Impl : public AbstractSWIGTableIterator, SWIGGeneralIter
m_was_null = true;
return "";
}
if (m_types[col].type != HASHTYPE) {
if (m_types[col].type != BINARY) {
m_exch->setException("E-UDF-CL-LIB-1069: Wrong input column type, expected BINARY, got "+
exaudflib::msg_conversion::convert_type_to_string(m_types[col].type));
m_was_null = true;
Expand Down
2 changes: 1 addition & 1 deletion exaudfclient/base/exaudflib/swig/swig_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ enum SWIGVM_datatype_e {
INTERVALYM = 9,
INTERVALDS = 10,
GEOMETRY = 11,
HASHTYPE = 12
BINARY = 12
};


Expand Down
1 change: 1 addition & 0 deletions exaudfclient/base/exaudflib/zmqcontainer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ enum column_type {
PB_TIMESTAMP = 5; // TIMESTAMP
PB_DATE = 6; // DATE
PB_STRING = 7; // CHAR or VARCHAR
PB_BINARY = 12; // HASHTYPE
PB_BOOLEAN = 8; // BOOL
}

Expand Down
4 changes: 2 additions & 2 deletions exaudfclient/base/python/python3/python_ext_dataframe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ std::map<int, std::string> emitTypeMap {
{SWIGVMContainers::INTERVALYM, "INTERVALYM"},
{SWIGVMContainers::INTERVALDS, "INTERVALDS"},
{SWIGVMContainers::GEOMETRY, "GEOMETRY"},
{SWIGVMContainers::HASHTYPE, "HASHTYPE"}
{SWIGVMContainers::BINARY, "BINARY"}
};


Expand Down Expand Up @@ -297,7 +297,7 @@ PyObject *getColumnData(std::vector<ColumnInfo>& colInfo, PyObject *tableIter, l
case SWIGVMContainers::STRING:
methodName = "getString";
break;
case SWIGVMContainers::HASHTYPE:
case SWIGVMContainers::BINARY:
methodName = "getBinary";
break;
case SWIGVMContainers::BOOLEAN:
Expand Down

0 comments on commit 06cbbea

Please sign in to comment.