OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com.mapd.parser.server.ExtensionFunction Class Reference
+ Collaboration diagram for com.mapd.parser.server.ExtensionFunction:

Classes

enum  ExtArgumentType
 

Public Member Functions

List< ExtArgumentTypegetArgs ()
 
ExtArgumentType getRet ()
 
boolean isRowUdf ()
 
boolean isTableUdf ()
 
String toJson (final String name)
 

Package Functions

 ExtensionFunction (final List< ExtArgumentType > args, final ExtArgumentType ret)
 
 ExtensionFunction (final List< ExtArgumentType > args, final ExtArgumentType ret, final boolean row_udf)
 

Static Package Attributes

static final Logger MAPDLOGGER = LoggerFactory.getLogger(ExtensionFunction.class)
 

Static Private Member Functions

static String typeName (final ExtArgumentType type)
 
static String dq (final String str)
 

Private Attributes

final List< ExtArgumentTypeargs
 
final ExtArgumentType ret
 
final boolean isRowUdf
 

Detailed Description

Author
alex

Definition at line 28 of file ExtensionFunction.java.

Constructor & Destructor Documentation

com.mapd.parser.server.ExtensionFunction.ExtensionFunction ( final List< ExtArgumentType args,
final ExtArgumentType  ret 
)
inlinepackage

Definition at line 59 of file ExtensionFunction.java.

References com.mapd.parser.server.ExtensionFunction.args, and com.mapd.parser.server.ExtensionFunction.ret.

59  {
60  this.args = args;
61  this.ret = ret;
62  this.isRowUdf = true;
63  }
com.mapd.parser.server.ExtensionFunction.ExtensionFunction ( final List< ExtArgumentType args,
final ExtArgumentType  ret,
final boolean  row_udf 
)
inlinepackage

Definition at line 65 of file ExtensionFunction.java.

References com.mapd.parser.server.ExtensionFunction.args, and com.mapd.parser.server.ExtensionFunction.ret.

67  {
68  this.args = args;
69  this.ret = ret;
70  this.isRowUdf = row_udf;
71  }

Member Function Documentation

static String com.mapd.parser.server.ExtensionFunction.dq ( final String  str)
inlinestaticprivate

Definition at line 163 of file ExtensionFunction.java.

Referenced by com.mapd.parser.server.ExtensionFunction.toJson().

163  {
164  return "\"" + str + "\"";
165  }

+ Here is the caller graph for this function:

List<ExtArgumentType> com.mapd.parser.server.ExtensionFunction.getArgs ( )
inline

Definition at line 73 of file ExtensionFunction.java.

References run_benchmark_import.args.

73  {
74  return this.args;
75  }
ExtArgumentType com.mapd.parser.server.ExtensionFunction.getRet ( )
inline

Definition at line 77 of file ExtensionFunction.java.

Referenced by com.mapd.calcite.parser.MapDSqlOperatorTable.ExtFunction.ExtFunction().

77  {
78  return this.ret;
79  }

+ Here is the caller graph for this function:

boolean com.mapd.parser.server.ExtensionFunction.isRowUdf ( )
inline

Definition at line 81 of file ExtensionFunction.java.

81  {
82  return this.isRowUdf;
83  }
boolean com.mapd.parser.server.ExtensionFunction.isTableUdf ( )
inline

Definition at line 85 of file ExtensionFunction.java.

85  {
86  return !this.isRowUdf();
87  }
String com.mapd.parser.server.ExtensionFunction.toJson ( final String  name)
inline

Definition at line 89 of file ExtensionFunction.java.

References File_Namespace.append(), com.mapd.parser.server.ExtensionFunction.args, com.mapd.parser.server.ExtensionFunction.dq(), com.mapd.parser.server.ExtensionFunction.ret, and com.mapd.parser.server.ExtensionFunction.typeName().

89  {
90  MAPDLOGGER.debug("Extensionfunction::toJson: " + name);
91  StringBuilder json_cons = new StringBuilder();
92  json_cons.append("{");
93  json_cons.append("\"name\":").append(dq(name)).append(",");
94  json_cons.append("\"ret\":").append(dq(typeName(ret))).append(",");
95  json_cons.append("\"args\":");
96  json_cons.append("[");
97  List<String> param_list = new ArrayList<String>();
98  for (final ExtArgumentType arg : args) {
99  param_list.add(dq(typeName(arg)));
100  }
101  json_cons.append(ExtensionFunctionSignatureParser.join(param_list, ","));
102  json_cons.append("]");
103  json_cons.append("}");
104  return json_cons.toString();
105  }
size_t append(FILE *f, const size_t size, int8_t *buf)
Appends the specified number of bytes to the end of the file f from buf.
Definition: File.cpp:136
static String typeName(final ExtArgumentType type)
static String dq(final String str)

+ Here is the call graph for this function:

static String com.mapd.parser.server.ExtensionFunction.typeName ( final ExtArgumentType  type)
inlinestaticprivate

Definition at line 107 of file ExtensionFunction.java.

References ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, assert(), Bool, Cursor, Double, Float, GeoLineString, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, and Void.

Referenced by com.mapd.parser.server.ExtensionFunction.toJson().

107  {
108  switch (type) {
109  case Bool:
110  return "i1";
111  case Int8:
112  return "i8";
113  case Int16:
114  return "i16";
115  case Int32:
116  return "i32";
117  case Int64:
118  return "i64";
119  case Float:
120  return "float";
121  case Double:
122  return "double";
123  case Void:
124  return "void";
125  case PInt8:
126  return "i8*";
127  case PInt16:
128  return "i16*";
129  case PInt32:
130  return "i32*";
131  case PInt64:
132  return "i64*";
133  case PFloat:
134  return "float*";
135  case PDouble:
136  return "double*";
137  case ArrayInt8:
138  return "array_i8";
139  case ArrayInt16:
140  return "array_i16";
141  case ArrayInt32:
142  return "array_i32";
143  case ArrayInt64:
144  return "array_i64";
145  case ArrayFloat:
146  return "array_float";
147  case ArrayDouble:
148  return "array_double";
149  case GeoPoint:
150  return "geo_point";
151  case Cursor:
152  return "cursor";
153  case GeoLineString:
154  return "geo_linestring";
155  case GeoPolygon:
156  return "geo_polygon";
157  }
158  MAPDLOGGER.info("Extensionfunction::typeName: unknown type=`" + type + "`");
159  assert false;
160  return null;
161  }
int64_t const int32_t sz assert(dest)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

final List<ExtArgumentType> com.mapd.parser.server.ExtensionFunction.args
private
final boolean com.mapd.parser.server.ExtensionFunction.isRowUdf
private

Definition at line 169 of file ExtensionFunction.java.

final Logger com.mapd.parser.server.ExtensionFunction.MAPDLOGGER = LoggerFactory.getLogger(ExtensionFunction.class)
staticpackage

Definition at line 29 of file ExtensionFunction.java.

final ExtArgumentType com.mapd.parser.server.ExtensionFunction.ret
private

The documentation for this class was generated from the following file: