OmniSciDB  f632821e96
table_functions::anonymous_namespace{TableFunctionsFactory.cpp} Namespace Reference

Functions

SQLTypeInfo ext_arg_pointer_type_to_type_info (const ExtArgumentType ext_arg_type)
 
std::string drop_suffix (const std::string &str)
 

Function Documentation

◆ drop_suffix()

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

Definition at line 141 of file TableFunctionsFactory.cpp.

References CHECK_GT.

Referenced by table_functions::TableFunctionsFactory::get_table_funcs().

141  {
142  const auto idx = str.find("__");
143  if (idx == std::string::npos) {
144  return str;
145  }
146  CHECK_GT(idx, std::string::size_type(0));
147  return str.substr(0, idx);
148 }
#define CHECK_GT(x, y)
Definition: Logger.h:209
+ Here is the caller graph for this function:

◆ ext_arg_pointer_type_to_type_info()

SQLTypeInfo table_functions::anonymous_namespace{TableFunctionsFactory.cpp}::ext_arg_pointer_type_to_type_info ( const ExtArgumentType  ext_arg_type)

Definition at line 28 of file TableFunctionsFactory.cpp.

References ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, kBIGINT, kBOOLEAN, kCOLUMN, kDOUBLE, kFLOAT, kINT, kNULLT, kSMALLINT, kTINYINT, LOG, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, ExtensionFunctionsWhitelist::toString(), UNREACHABLE, and logger::WARNING.

Referenced by table_functions::TableFunction::getInputSQLType(), and table_functions::TableFunction::getOutputSQLType().

28  {
29  auto generate_column_type = [](const auto subtype) {
30  auto ti = SQLTypeInfo(kCOLUMN, false);
31  ti.set_subtype(subtype);
32  return ti;
33  };
34  switch (ext_arg_type) {
36  return SQLTypeInfo(kTINYINT, false);
38  return SQLTypeInfo(kSMALLINT, false);
40  return SQLTypeInfo(kINT, false);
42  return SQLTypeInfo(kBIGINT, false);
44  return SQLTypeInfo(kFLOAT, false);
46  return SQLTypeInfo(kDOUBLE, false);
48  return SQLTypeInfo(kBOOLEAN, false);
50  return generate_column_type(kTINYINT);
52  return generate_column_type(kSMALLINT);
54  return generate_column_type(kINT);
56  return generate_column_type(kBIGINT);
58  return generate_column_type(kFLOAT);
60  return generate_column_type(kDOUBLE);
62  return generate_column_type(kBOOLEAN);
63  default:
64  LOG(WARNING) << "ext_arg_pointer_type_to_type_info: ExtArgumentType `"
66  << "` conversion to SQLTypeInfo not implemented.";
67  UNREACHABLE();
68  }
69  UNREACHABLE();
70  return SQLTypeInfo(kNULLT, false);
71 }
#define LOG(tag)
Definition: Logger.h:188
#define UNREACHABLE()
Definition: Logger.h:241
static std::string toString(const std::vector< ExtensionFunction > &ext_funcs, std::string tab="")
Definition: sqltypes.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function: