OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{ExtensionFunctionsWhitelist.cpp} Namespace Reference

Functions

std::string serialize_type (const ExtArgumentType type, bool byval=true, bool declare=false)
 
std::string drop_suffix (const std::string &str)
 
ExtArgumentType deserialize_type (const std::string &type_name)
 

Function Documentation

ExtArgumentType anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::deserialize_type ( const std::string &  type_name)

Definition at line 683 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, ArrayTextEncodingDict, Bool, CHECK, ColumnArrayBool, ColumnArrayDouble, ColumnArrayFloat, ColumnArrayInt16, ColumnArrayInt32, ColumnArrayInt64, ColumnArrayInt8, ColumnArrayTextEncodingDict, ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListArrayBool, ColumnListArrayDouble, ColumnListArrayFloat, ColumnListArrayInt16, ColumnListArrayInt32, ColumnListArrayInt64, ColumnListArrayInt8, ColumnListArrayTextEncodingDict, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListInt8, ColumnListTextEncodingDict, ColumnTextEncodingDict, ColumnTimestamp, Cursor, DayTimeInterval, Double, Float, GeoLineString, GeoMultiLineString, GeoMultiPoint, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict, TextEncodingNone, Timestamp, Void, and YearMonthTimeInterval.

Referenced by ExtensionFunctionsWhitelist::addCommon().

683  {
684  if (type_name == "bool" || type_name == "i1") {
685  return ExtArgumentType::Bool;
686  }
687  if (type_name == "i8") {
688  return ExtArgumentType::Int8;
689  }
690  if (type_name == "i16") {
691  return ExtArgumentType::Int16;
692  }
693  if (type_name == "i32") {
694  return ExtArgumentType::Int32;
695  }
696  if (type_name == "i64") {
697  return ExtArgumentType::Int64;
698  }
699  if (type_name == "float") {
700  return ExtArgumentType::Float;
701  }
702  if (type_name == "double") {
704  }
705  if (type_name == "void") {
706  return ExtArgumentType::Void;
707  }
708  if (type_name == "i8*") {
709  return ExtArgumentType::PInt8;
710  }
711  if (type_name == "i16*") {
713  }
714  if (type_name == "i32*") {
716  }
717  if (type_name == "i64*") {
719  }
720  if (type_name == "float*") {
722  }
723  if (type_name == "double*") {
725  }
726  if (type_name == "i1*" || type_name == "bool*") {
727  return ExtArgumentType::PBool;
728  }
729  if (type_name == "Array<i8>") {
731  }
732  if (type_name == "Array<i16>") {
734  }
735  if (type_name == "Array<i32>") {
737  }
738  if (type_name == "Array<i64>") {
740  }
741  if (type_name == "Array<float>") {
743  }
744  if (type_name == "Array<double>") {
746  }
747  if (type_name == "Array<bool>" || type_name == "Array<i1>") {
749  }
750  if (type_name == "Array<TextEncodingDict>") {
752  }
753  if (type_name == "geo_point") {
755  }
756  if (type_name == "geo_multi_point") {
758  }
759  if (type_name == "geo_linestring") {
761  }
762  if (type_name == "geo_multi_linestring") {
764  }
765  if (type_name == "geo_polygon") {
767  }
768  if (type_name == "geo_multi_polygon") {
770  }
771  if (type_name == "cursor") {
773  }
774  if (type_name == "Column<i8>") {
776  }
777  if (type_name == "Column<i16>") {
779  }
780  if (type_name == "Column<i32>") {
782  }
783  if (type_name == "Column<i64>") {
785  }
786  if (type_name == "Column<float>") {
788  }
789  if (type_name == "Column<double>") {
791  }
792  if (type_name == "Column<bool>") {
794  }
795  if (type_name == "Column<TextEncodingDict>") {
797  }
798  if (type_name == "Column<Timestamp>") {
800  }
801  if (type_name == "TextEncodingNone") {
803  }
804  if (type_name == "TextEncodingDict") {
806  }
807  if (type_name == "timestamp") {
809  }
810  if (type_name == "ColumnList<i8>") {
812  }
813  if (type_name == "ColumnList<i16>") {
815  }
816  if (type_name == "ColumnList<i32>") {
818  }
819  if (type_name == "ColumnList<i64>") {
821  }
822  if (type_name == "ColumnList<float>") {
824  }
825  if (type_name == "ColumnList<double>") {
827  }
828  if (type_name == "ColumnList<bool>") {
830  }
831  if (type_name == "ColumnList<TextEncodingDict>") {
833  }
834  if (type_name == "Column<Array<i8>>") {
836  }
837  if (type_name == "Column<Array<i16>>") {
839  }
840  if (type_name == "Column<Array<i32>>") {
842  }
843  if (type_name == "Column<Array<i64>>") {
845  }
846  if (type_name == "Column<Array<float>>") {
848  }
849  if (type_name == "Column<Array<double>>") {
851  }
852  if (type_name == "Column<Array<bool>>") {
854  }
855  if (type_name == "Column<Array<TextEncodingDict>>") {
857  }
858  if (type_name == "ColumnList<Array<i8>>") {
860  }
861  if (type_name == "ColumnList<Array<i16>>") {
863  }
864  if (type_name == "ColumnList<Array<i32>>") {
866  }
867  if (type_name == "ColumnList<Array<i64>>") {
869  }
870  if (type_name == "ColumnList<Array<float>>") {
872  }
873  if (type_name == "ColumnList<Array<double>>") {
875  }
876  if (type_name == "ColumnList<Array<bool>>") {
878  }
879  if (type_name == "ColumnList<Array<TextEncodingDict>>") {
881  }
882  if (type_name == "DayTimeInterval") {
884  }
885  if (type_name == "YearMonthTimeInterval") {
887  }
888  CHECK(false);
889  return ExtArgumentType::Int16;
890 }
#define CHECK(condition)
Definition: Logger.h:289
constexpr auto type_name() noexcept

+ Here is the caller graph for this function:

std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::drop_suffix ( const std::string &  str)

Definition at line 302 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

Referenced by ExtensionFunctionsWhitelist::addCommon(), and ExtensionFunction::getName().

302  {
303  const auto idx = str.find("__");
304  if (idx == std::string::npos) {
305  return str;
306  }
307  CHECK_GT(idx, std::string::size_type(0));
308  return str.substr(0, idx);
309 }
#define CHECK_GT(x, y)
Definition: Logger.h:301

+ Here is the caller graph for this function:

std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type ( const ExtArgumentType  type,
bool  byval = true,
bool  declare = false 
)

Definition at line 155 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, ArrayTextEncodingDict, Bool, CHECK, ColumnArrayBool, ColumnArrayDouble, ColumnArrayFloat, ColumnArrayInt16, ColumnArrayInt32, ColumnArrayInt64, ColumnArrayInt8, ColumnArrayTextEncodingDict, ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListArrayBool, ColumnListArrayDouble, ColumnListArrayFloat, ColumnListArrayInt16, ColumnListArrayInt32, ColumnListArrayInt64, ColumnListArrayInt8, ColumnListArrayTextEncodingDict, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListInt8, ColumnListTextEncodingDict, ColumnTextEncodingDict, ColumnTimestamp, Cursor, DayTimeInterval, Double, Float, GeoLineString, GeoMultiLineString, GeoMultiPoint, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict, TextEncodingNone, Timestamp, Void, and YearMonthTimeInterval.

Referenced by ext_arg_type_to_type_info(), ExtensionFunctionsWhitelist::getLLVMDeclarations(), and ExtensionFunctionsWhitelist::toString().

157  {
158  switch (type) {
160  return "i8"; // clang converts bool to i8
162  return "i8";
164  return "i16";
166  return "i32";
168  return "i64";
170  return "float";
172  return "double";
174  return "void";
176  return "i8*";
178  return "i16*";
180  return "i32*";
182  return "i64*";
184  return "float*";
186  return "double*";
188  return "i1*";
190  return (declare ? "{i8*, i64, i8}*" : "Array<i8>");
192  return (declare ? "{i16*, i64, i8}*" : "Array<i16>");
194  return (declare ? "{i32*, i64, i8}*" : "Array<i32>");
196  return (declare ? "{i64*, i64, i8}*" : "Array<i64>");
198  return (declare ? "{float*, i64, i8}*" : "Array<float>");
200  return (declare ? "{double*, i64, i8}*" : "Array<double>");
202  return (declare ? "{i1*, i64, i8}*" : "Array<i1>");
204  return (declare ? "{i32*, i64, i8}*" : "Array<TextEncodingDict>");
206  return "geo_point";
208  return "geo_multi_point";
210  return "geo_linestring";
212  return "geo_multi_linestring";
214  return "geo_polygon";
216  return "geo_multi_polygon";
218  return "cursor";
220  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "Column<i8>");
222  return (declare ? (byval ? "{i16*, i64}" : "i8*") : "Column<i16>");
224  return (declare ? (byval ? "{i32*, i64}" : "i8*") : "Column<i32>");
226  return (declare ? (byval ? "{i64*, i64}" : "i8*") : "Column<i64>");
228  return (declare ? (byval ? "{float*, i64}" : "i8*") : "Column<float>");
230  return (declare ? (byval ? "{double*, i64}" : "i8*") : "Column<double>");
232  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "Column<bool>");
234  return (declare ? (byval ? "{i32*, i64}" : "i8*") : "Column<TextEncodingDict>");
236  return (declare ? (byval ? "{i64*, i64}" : "i8*") : "Column<Timestamp>");
238  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "TextEncodingNone");
240  return (declare ? "{ i32 }" : "TextEncodingDict");
242  return (declare ? "{ i64 }" : "Timestamp");
244  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i8>");
246  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i16>");
248  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i32>");
250  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i64>");
252  return (declare ? "{i8**, i64, i64}*" : "ColumnList<float>");
254  return (declare ? "{i8**, i64, i64}*" : "ColumnList<double>");
256  return (declare ? "{i8**, i64, i64}*" : "ColumnList<bool>");
258  return (declare ? "{i8**, i64, i64}*" : "ColumnList<TextEncodingDict>");
260  return (declare ? "{i8*, i64}*" : "Column<Array<i8>>");
262  return (declare ? "{i8*, i64}*" : "Column<Array<i16>>");
264  return (declare ? "{i8*, i64}*" : "Column<Array<i32>>");
266  return (declare ? "{i8*, i64}*" : "Column<Array<i64>>");
268  return (declare ? "{i8*, i64}*" : "Column<Array<float>>");
270  return (declare ? "{i8*, i64}*" : "Column<Array<double>>");
272  return (declare ? "{i8*, i64}*" : "Column<Array<bool>>");
274  return (declare ? "{i8*, i64}" : "Column<Array<TextEncodingDict>>");
276  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i8>");
278  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i16>");
280  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i32>");
282  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i64>");
284  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<float>");
286  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<double>");
288  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<bool>");
290  return (declare ? "{i8**, i64, i64}" : "ColumnList<Array<TextEncodingDict>>");
292  return (declare ? "{ i64 }" : "DayTimeInterval");
294  return (declare ? "{ i64 }" : "YearMonthTimeInterval");
295  default:
296  CHECK(false);
297  }
298  CHECK(false);
299  return "";
300 }
#define CHECK(condition)
Definition: Logger.h:289

+ Here is the caller graph for this function: