OmniSciDB  cecceef8da
 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 60 of file ExtensionFunction.java.

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

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

Definition at line 66 of file ExtensionFunction.java.

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

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

Member Function Documentation

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

Definition at line 166 of file ExtensionFunction.java.

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

166  {
167  return "\"" + str + "\"";
168  }

+ Here is the caller graph for this function:

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

Definition at line 74 of file ExtensionFunction.java.

References run_benchmark_import.args.

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

Definition at line 78 of file ExtensionFunction.java.

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

78  {
79  return this.ret;
80  }

+ Here is the caller graph for this function:

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

Definition at line 82 of file ExtensionFunction.java.

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

Definition at line 86 of file ExtensionFunction.java.

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

Definition at line 90 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().

90  {
91  MAPDLOGGER.debug("Extensionfunction::toJson: " + name);
92  StringBuilder json_cons = new StringBuilder();
93  json_cons.append("{");
94  json_cons.append("\"name\":").append(dq(name)).append(",");
95  json_cons.append("\"ret\":").append(dq(typeName(ret))).append(",");
96  json_cons.append("\"args\":");
97  json_cons.append("[");
98  List<String> param_list = new ArrayList<String>();
99  for (final ExtArgumentType arg : args) {
100  param_list.add(dq(typeName(arg)));
101  }
102  json_cons.append(ExtensionFunctionSignatureParser.join(param_list, ","));
103  json_cons.append("]");
104  json_cons.append("}");
105  return json_cons.toString();
106  }
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:135
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 108 of file ExtensionFunction.java.

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

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

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