OmniSciDB  baf940c279
com.mapd.parser.server.CalciteServerHandler Class Reference
+ Inheritance diagram for com.mapd.parser.server.CalciteServerHandler:
+ Collaboration diagram for com.mapd.parser.server.CalciteServerHandler:

Public Member Functions

 CalciteServerHandler (int mapdPort, String dataDir, String extensionFunctionsAstFile, SockTransportProperties skT, String udfAstFile)
 
void ping () throws TException
 
TPlanResult process (String user, String session, String catalog, String sqlText, java.util.List< TFilterPushDownInfo > thriftFilterPushDownInfo, boolean legacySyntax, boolean isExplain, boolean isViewOptimize) throws InvalidParseRequest, TException
 
void shutdown () throws TException
 
String getExtensionFunctionWhitelist ()
 
String getUserDefinedFunctionWhitelist ()
 
String getRuntimeExtensionFunctionWhitelist ()
 
void updateMetadata (String catalog, String table) throws TException
 
List< TCompletionHint > getCompletionHints (String user, String session, String catalog, List< String > visible_tables, String sql, int cursor) throws TException
 
void setRuntimeExtensionFunctions (List< TUserDefinedFunction > udfs, List< TUserDefinedTableFunction > udtfs)
 

Package Functions

void setServer (TServer s)
 

Package Attributes

Map< String, ExtensionFunctionudfRTSigs = null
 

Static Package Attributes

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

Static Private Member Functions

static ExtensionFunction toExtensionFunction (TUserDefinedFunction udf)
 
static ExtensionFunction toExtensionFunction (TUserDefinedTableFunction udtf)
 
static ExtensionFunction.ExtArgumentType toExtArgumentType (TExtArgumentType type)
 
static TCompletionHintType hintTypeToThrift (final SqlMonikerType type)
 

Private Attributes

TServer server
 
final int mapdPort
 
volatile long callCount
 
final GenericObjectPool parserPool
 
final CalciteParserFactory calciteParserFactory
 
final String extSigsJson
 
final String udfSigsJson
 
String udfRTSigsJson = ""
 
SockTransportProperties skT
 
Map< String, ExtensionFunctionextSigs = null
 
String dataDir
 

Detailed Description

Author
michael

Definition at line 62 of file CalciteServerHandler.java.

Constructor & Destructor Documentation

◆ CalciteServerHandler()

com.mapd.parser.server.CalciteServerHandler.CalciteServerHandler ( int  mapdPort,
String  dataDir,
String  extensionFunctionsAstFile,
SockTransportProperties  skT,
String  udfAstFile 
)
inline

Definition at line 87 of file CalciteServerHandler.java.

References com.mapd.parser.server.CalciteServerHandler.dataDir, com.mapd.parser.server.CalciteServerHandler.mapdPort, com.mapd.parser.server.ExtensionFunctionSignatureParser.parse(), com.mapd.parser.server.ExtensionFunctionSignatureParser.parseUdfAst(), and com.mapd.parser.server.ExtensionFunctionSignatureParser.signaturesToJson().

91  {
92  this.mapdPort = mapdPort;
93  this.dataDir = dataDir;
94 
95  Map<String, ExtensionFunction> udfSigs = null;
96 
97  try {
98  extSigs = ExtensionFunctionSignatureParser.parse(extensionFunctionsAstFile);
99  } catch (IOException ex) {
100  MAPDLOGGER.error(
101  "Could not load extension function signatures: " + ex.getMessage(), ex);
102  }
103  extSigsJson = ExtensionFunctionSignatureParser.signaturesToJson(extSigs);
104 
105  try {
106  if (!udfAstFile.isEmpty()) {
107  udfSigs = ExtensionFunctionSignatureParser.parseUdfAst(udfAstFile);
108  }
109  } catch (IOException ex) {
110  MAPDLOGGER.error("Could not load udf function signatures: " + ex.getMessage(), ex);
111  }
112  udfSigsJson = ExtensionFunctionSignatureParser.signaturesToJson(udfSigs);
113 
114  // Put all the udf functions signatures in extSigs so Calcite has a view of
115  // extension functions and udf functions
116  if (!udfAstFile.isEmpty()) {
117  extSigs.putAll(udfSigs);
118  }
119 
120  calciteParserFactory = new CalciteParserFactory(dataDir, extSigs, mapdPort, skT);
121 
122  // GenericObjectPool::setFactory is deprecated
123  this.parserPool = new GenericObjectPool(calciteParserFactory);
124  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getCompletionHints()

List<TCompletionHint> com.mapd.parser.server.CalciteServerHandler.getCompletionHints ( String  user,
String  session,
String  catalog,
List< String >  visible_tables,
String  sql,
int  cursor 
) throws TException
inline

Definition at line 296 of file CalciteServerHandler.java.

References com.mapd.calcite.parser.MapDParser.getCompletionHints(), com.mapd.parser.server.CalciteServerHandler.hintTypeToThrift(), run_benchmark_import.parser, run_benchmark_import.result, and com.mapd.calcite.parser.MapDParser.setUser().

301  {
302  callCount++;
303  MapDParser parser;
304  try {
305  parser = (MapDParser) parserPool.borrowObject();
306  } catch (Exception ex) {
307  String msg = "Could not get Parse Item from pool: " + ex.getMessage();
308  MAPDLOGGER.error(msg, ex);
309  throw new TException(msg);
310  }
311  MapDUser mapDUser = new MapDUser(user, session, catalog, mapdPort);
312  MAPDLOGGER.debug("getCompletionHints was called User: " + user
313  + " Catalog: " + catalog + " sql: " + sql);
314  parser.setUser(mapDUser);
315  CURRENT_PARSER.set(parser);
316 
317  MapDPlanner.CompletionResult completion_result;
318  try {
319  completion_result = parser.getCompletionHints(sql, cursor, visible_tables);
320  } catch (Exception ex) {
321  String msg = "Could not retrieve completion hints: " + ex.getMessage();
322  MAPDLOGGER.error(msg, ex);
323  return new ArrayList<>();
324  } finally {
325  CURRENT_PARSER.set(null);
326  try {
327  // put parser object back in pool for others to use
328  parserPool.returnObject(parser);
329  } catch (Exception ex) {
330  String msg = "Could not return parse object: " + ex.getMessage();
331  MAPDLOGGER.error(msg, ex);
332  throw new InvalidParseRequest(-4, msg);
333  }
334  }
335  List<TCompletionHint> result = new ArrayList<>();
336  for (final SqlMoniker hint : completion_result.hints) {
337  result.add(new TCompletionHint(hintTypeToThrift(hint.getType()),
338  hint.getFullyQualifiedNames(),
339  completion_result.replaced));
340  }
341  return result;
342  }
static TCompletionHintType hintTypeToThrift(final SqlMonikerType type)
+ Here is the call graph for this function:

◆ getExtensionFunctionWhitelist()

String com.mapd.parser.server.CalciteServerHandler.getExtensionFunctionWhitelist ( )
inline

◆ getRuntimeExtensionFunctionWhitelist()

String com.mapd.parser.server.CalciteServerHandler.getRuntimeExtensionFunctionWhitelist ( )
inline

◆ getUserDefinedFunctionWhitelist()

String com.mapd.parser.server.CalciteServerHandler.getUserDefinedFunctionWhitelist ( )
inline

◆ hintTypeToThrift()

static TCompletionHintType com.mapd.parser.server.CalciteServerHandler.hintTypeToThrift ( final SqlMonikerType  type)
inlinestaticprivate

Definition at line 484 of file CalciteServerHandler.java.

References TABLE.

Referenced by com.mapd.parser.server.CalciteServerHandler.getCompletionHints().

484  {
485  switch (type) {
486  case COLUMN:
487  return TCompletionHintType.COLUMN;
488  case TABLE:
489  return TCompletionHintType.TABLE;
490  case VIEW:
491  return TCompletionHintType.VIEW;
492  case SCHEMA:
493  return TCompletionHintType.SCHEMA;
494  case CATALOG:
495  return TCompletionHintType.CATALOG;
496  case REPOSITORY:
497  return TCompletionHintType.REPOSITORY;
498  case FUNCTION:
499  return TCompletionHintType.FUNCTION;
500  case KEYWORD:
501  return TCompletionHintType.KEYWORD;
502  default:
503  return null;
504  }
505  }
+ Here is the caller graph for this function:

◆ ping()

void com.mapd.parser.server.CalciteServerHandler.ping ( ) throws TException
inline

Definition at line 127 of file CalciteServerHandler.java.

127  {
128  MAPDLOGGER.debug("Ping hit");
129  }

◆ process()

TPlanResult com.mapd.parser.server.CalciteServerHandler.process ( String  user,
String  session,
String  catalog,
String  sqlText,
java.util.List< TFilterPushDownInfo >  thriftFilterPushDownInfo,
boolean  legacySyntax,
boolean  isExplain,
boolean  isViewOptimize 
) throws InvalidParseRequest, TException
inline

Definition at line 132 of file CalciteServerHandler.java.

References com.mapd.calcite.parser.MapDParser.clearMemo(), org.apache.calcite.prepare.SqlIdentifierCapturer.deletes, org.apache.calcite.prepare.SqlIdentifierCapturer.inserts, run_benchmark_import.parser, com.mapd.calcite.parser.MapDParser.process(), run_benchmark_import.res, com.mapd.calcite.parser.MapDParser.resolveSelectIdentifiers(), run_benchmark_import.result, org.apache.calcite.prepare.SqlIdentifierCapturer.selects, com.mapd.calcite.parser.MapDParser.setUser(), and org.apache.calcite.prepare.SqlIdentifierCapturer.updates.

Referenced by com.mapd.parser.extension.ddl.DDLTest.processDdlCommand().

139  {
140  long timer = System.currentTimeMillis();
141  callCount++;
142 
143  MapDParser parser;
144  try {
145  parser = (MapDParser) parserPool.borrowObject();
146  parser.clearMemo();
147  } catch (Exception ex) {
148  String msg = "Could not get Parse Item from pool: " + ex.getMessage();
149  MAPDLOGGER.error(msg, ex);
150  throw new InvalidParseRequest(-1, msg);
151  }
152  MapDUser mapDUser = new MapDUser(user, session, catalog, mapdPort);
153  MAPDLOGGER.debug("process was called User: " + user + " Catalog: " + catalog
154  + " sql: " + sqlText);
155  parser.setUser(mapDUser);
156  CURRENT_PARSER.set(parser);
157 
158  // need to trim the sql string as it seems it is not trimed prior to here
159  sqlText = sqlText.trim();
160  // remove last charcter if it is a ;
161  if (sqlText.length() > 0 && sqlText.charAt(sqlText.length() - 1) == ';') {
162  sqlText = sqlText.substring(0, sqlText.length() - 1);
163  }
164  String jsonResult;
165  SqlIdentifierCapturer capturer;
166  TAccessedQueryObjects primaryAccessedObjects = new TAccessedQueryObjects();
167  TAccessedQueryObjects resolvedAccessedObjects = new TAccessedQueryObjects();
168  try {
169  final List<MapDParserOptions.FilterPushDownInfo> filterPushDownInfo =
170  new ArrayList<>();
171  for (final TFilterPushDownInfo req : thriftFilterPushDownInfo) {
172  filterPushDownInfo.add(new MapDParserOptions.FilterPushDownInfo(
173  req.input_prev, req.input_start, req.input_next));
174  }
175  Pair<String, SqlIdentifierCapturer> res;
176  SqlNode node;
177  try {
178  MapDParserOptions parserOptions = new MapDParserOptions(
179  filterPushDownInfo, legacySyntax, isExplain, isViewOptimize);
180  res = parser.process(sqlText, parserOptions);
181  jsonResult = res.left;
182  } catch (ValidationException ex) {
183  String msg = "Validation: " + ex.getMessage();
184  MAPDLOGGER.error(msg, ex);
185  throw ex;
186  } catch (RelConversionException ex) {
187  String msg = " RelConversion failed: " + ex.getMessage();
188  MAPDLOGGER.error(msg, ex);
189  throw ex;
190  }
191  capturer = res.right;
192 
193  primaryAccessedObjects.tables_selected_from = new ArrayList<>(capturer.selects);
194  primaryAccessedObjects.tables_inserted_into = new ArrayList<>(capturer.inserts);
195  primaryAccessedObjects.tables_updated_in = new ArrayList<>(capturer.updates);
196  primaryAccessedObjects.tables_deleted_from = new ArrayList<>(capturer.deletes);
197 
198  // also resolve all the views in the select part
199  // resolution of the other parts is not
200  // necessary as these cannot be views
201  resolvedAccessedObjects.tables_selected_from =
202  new ArrayList<>(parser.resolveSelectIdentifiers(capturer));
203  resolvedAccessedObjects.tables_inserted_into = new ArrayList<>(capturer.inserts);
204  resolvedAccessedObjects.tables_updated_in = new ArrayList<>(capturer.updates);
205  resolvedAccessedObjects.tables_deleted_from = new ArrayList<>(capturer.deletes);
206 
207  } catch (SqlParseException ex) {
208  String msg = "Parse failed: " + ex.getMessage();
209  MAPDLOGGER.error(msg, ex);
210  throw new InvalidParseRequest(-2, msg);
211  } catch (CalciteContextException ex) {
212  String msg = "Validate failed: " + ex.getMessage();
213  MAPDLOGGER.error(msg, ex);
214  throw new InvalidParseRequest(-3, msg);
215  } catch (Throwable ex) {
216  String msg = "Exception occurred: " + ex.getMessage();
217  MAPDLOGGER.error(msg, ex);
218  throw new InvalidParseRequest(-4, msg);
219  } finally {
220  CURRENT_PARSER.set(null);
221  try {
222  // put parser object back in pool for others to use
223  parserPool.returnObject(parser);
224  } catch (Exception ex) {
225  String msg = "Could not return parse object: " + ex.getMessage();
226  MAPDLOGGER.error(msg, ex);
227  throw new InvalidParseRequest(-4, msg);
228  }
229  }
230 
231  TPlanResult result = new TPlanResult();
232  result.primary_accessed_objects = primaryAccessedObjects;
233  result.resolved_accessed_objects = resolvedAccessedObjects;
234  result.plan_result = jsonResult;
235  result.execution_time_ms = System.currentTimeMillis() - timer;
236 
237  return result;
238  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRuntimeExtensionFunctions()

void com.mapd.parser.server.CalciteServerHandler.setRuntimeExtensionFunctions ( List< TUserDefinedFunction >  udfs,
List< TUserDefinedTableFunction >  udtfs 
)
inline

Definition at line 345 of file CalciteServerHandler.java.

References setup.name, com.mapd.parser.server.ExtensionFunctionSignatureParser.signaturesToJson(), com.mapd.parser.server.CalciteServerHandler.toExtensionFunction(), and com.mapd.parser.server.CalciteParserFactory.updateOperatorTable().

346  {
347  // Clean up previously defined Runtime UDFs
348  if (udfRTSigs != null) {
349  for (String name : udfRTSigs.keySet()) extSigs.remove(name);
350  udfRTSigsJson = "";
351  udfRTSigs.clear();
352  } else {
353  udfRTSigs = new HashMap<String, ExtensionFunction>();
354  }
355 
356  for (TUserDefinedFunction udf : udfs) {
357  udfRTSigs.put(udf.name, toExtensionFunction(udf));
358  }
359 
360  for (TUserDefinedTableFunction udtf : udtfs) {
361  udfRTSigs.put(udtf.name, toExtensionFunction(udtf));
362  }
363 
364  // Avoid overwritting compiled and Loadtime UDFs:
365  for (String name : udfRTSigs.keySet()) {
366  if (extSigs.containsKey(name)) {
367  MAPDLOGGER.error("Extension function `" + name
368  + "` exists. Skipping runtime extenension function with the same name.");
369  udfRTSigs.remove(name);
370  }
371  }
372 
373  // udfRTSigsJson will contain only the signatures of UDFs:
374  udfRTSigsJson = ExtensionFunctionSignatureParser.signaturesToJson(udfRTSigs);
375  // Expose RT UDFs to Calcite server:
376  extSigs.putAll(udfRTSigs);
377 
379  }
name
Definition: setup.py:35
Map< String, ExtensionFunction > udfRTSigs
static ExtensionFunction toExtensionFunction(TUserDefinedFunction udf)
+ Here is the call graph for this function:

◆ setServer()

void com.mapd.parser.server.CalciteServerHandler.setServer ( TServer  s)
inlinepackage

Definition at line 262 of file CalciteServerHandler.java.

Referenced by com.mapd.parser.server.CalciteServerWrapper.startServer().

+ Here is the caller graph for this function:

◆ shutdown()

void com.mapd.parser.server.CalciteServerHandler.shutdown ( ) throws TException
inline

Definition at line 241 of file CalciteServerHandler.java.

241  {
242  // received request to shutdown
243  MAPDLOGGER.debug("Shutdown calcite java server");
244  server.stop();
245  }

◆ toExtArgumentType()

static ExtensionFunction.ExtArgumentType com.mapd.parser.server.CalciteServerHandler.toExtArgumentType ( TExtArgumentType  type)
inlinestaticprivate

Definition at line 407 of file CalciteServerHandler.java.

References com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ArrayBool, ArrayBool, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ArrayDouble, ArrayDouble, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ArrayFloat, ArrayFloat, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ArrayInt16, ArrayInt16, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ArrayInt32, ArrayInt32, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ArrayInt64, ArrayInt64, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ArrayInt8, ArrayInt8, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Bool, Bool, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ColumnBool, ColumnBool, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ColumnDouble, ColumnDouble, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ColumnFloat, ColumnFloat, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ColumnInt16, ColumnInt16, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ColumnInt32, ColumnInt32, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ColumnInt64, ColumnInt64, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.ColumnInt8, ColumnInt8, Cursor, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Cursor, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Double, Double, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Float, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.GeoLineString, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.GeoMultiPolygon, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.GeoPoint, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.GeoPolygon, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Int16, Int16, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Int32, Int32, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Int64, Int64, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Int8, Int8, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.PBool, PBool, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.PDouble, PDouble, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.PFloat, PFloat, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.PInt16, PInt16, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.PInt32, PInt32, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.PInt64, PInt64, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.PInt8, PInt8, com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Void, and Void.

Referenced by com.mapd.parser.server.CalciteServerHandler.toExtensionFunction().

408  {
409  switch (type) {
410  case Int8:
411  return ExtensionFunction.ExtArgumentType.Int8;
412  case Int16:
413  return ExtensionFunction.ExtArgumentType.Int16;
414  case Int32:
415  return ExtensionFunction.ExtArgumentType.Int32;
416  case Int64:
417  return ExtensionFunction.ExtArgumentType.Int64;
418  case Float:
419  return ExtensionFunction.ExtArgumentType.Float;
420  case Double:
421  return ExtensionFunction.ExtArgumentType.Double;
422  case Void:
423  return ExtensionFunction.ExtArgumentType.Void;
424  case PInt8:
425  return ExtensionFunction.ExtArgumentType.PInt8;
426  case PInt16:
427  return ExtensionFunction.ExtArgumentType.PInt16;
428  case PInt32:
429  return ExtensionFunction.ExtArgumentType.PInt32;
430  case PInt64:
431  return ExtensionFunction.ExtArgumentType.PInt64;
432  case PFloat:
433  return ExtensionFunction.ExtArgumentType.PFloat;
434  case PDouble:
435  return ExtensionFunction.ExtArgumentType.PDouble;
436  case PBool:
437  return ExtensionFunction.ExtArgumentType.PBool;
438  case Bool:
439  return ExtensionFunction.ExtArgumentType.Bool;
440  case ArrayInt8:
441  return ExtensionFunction.ExtArgumentType.ArrayInt8;
442  case ArrayInt16:
443  return ExtensionFunction.ExtArgumentType.ArrayInt16;
444  case ArrayInt32:
445  return ExtensionFunction.ExtArgumentType.ArrayInt32;
446  case ArrayInt64:
447  return ExtensionFunction.ExtArgumentType.ArrayInt64;
448  case ArrayFloat:
449  return ExtensionFunction.ExtArgumentType.ArrayFloat;
450  case ArrayDouble:
451  return ExtensionFunction.ExtArgumentType.ArrayDouble;
452  case ArrayBool:
453  return ExtensionFunction.ExtArgumentType.ArrayBool;
454  case ColumnInt8:
455  return ExtensionFunction.ExtArgumentType.ColumnInt8;
456  case ColumnInt16:
457  return ExtensionFunction.ExtArgumentType.ColumnInt16;
458  case ColumnInt32:
459  return ExtensionFunction.ExtArgumentType.ColumnInt32;
460  case ColumnInt64:
461  return ExtensionFunction.ExtArgumentType.ColumnInt64;
462  case ColumnFloat:
463  return ExtensionFunction.ExtArgumentType.ColumnFloat;
464  case ColumnDouble:
465  return ExtensionFunction.ExtArgumentType.ColumnDouble;
466  case ColumnBool:
467  return ExtensionFunction.ExtArgumentType.ColumnBool;
468  case GeoPoint:
469  return ExtensionFunction.ExtArgumentType.GeoPoint;
470  case GeoLineString:
471  return ExtensionFunction.ExtArgumentType.GeoLineString;
472  case Cursor:
473  return ExtensionFunction.ExtArgumentType.Cursor;
474  case GeoPolygon:
475  return ExtensionFunction.ExtArgumentType.GeoPolygon;
476  case GeoMultiPolygon:
477  return ExtensionFunction.ExtArgumentType.GeoMultiPolygon;
478  default:
479  MAPDLOGGER.error("toExtArgumentType: unknown type " + type);
480  return null;
481  }
482  }
+ Here is the caller graph for this function:

◆ toExtensionFunction() [1/2]

static ExtensionFunction com.mapd.parser.server.CalciteServerHandler.toExtensionFunction ( TUserDefinedFunction  udf)
inlinestaticprivate

Definition at line 381 of file CalciteServerHandler.java.

References run_benchmark_import.args, com.mapd.parser.server.CalciteServerHandler.toExtArgumentType(), and com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Void.

Referenced by com.mapd.parser.server.CalciteServerHandler.setRuntimeExtensionFunctions().

381  {
382  List<ExtensionFunction.ExtArgumentType> args =
383  new ArrayList<ExtensionFunction.ExtArgumentType>();
384  for (TExtArgumentType atype : udf.argTypes) {
385  final ExtensionFunction.ExtArgumentType arg_type = toExtArgumentType(atype);
386  if (arg_type != ExtensionFunction.ExtArgumentType.Void) {
387  args.add(arg_type);
388  }
389  }
390  return new ExtensionFunction(args, toExtArgumentType(udf.retType));
391  }
static ExtensionFunction.ExtArgumentType toExtArgumentType(TExtArgumentType type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toExtensionFunction() [2/2]

static ExtensionFunction com.mapd.parser.server.CalciteServerHandler.toExtensionFunction ( TUserDefinedTableFunction  udtf)
inlinestaticprivate

Definition at line 393 of file CalciteServerHandler.java.

References run_benchmark_import.args, and com.mapd.parser.server.CalciteServerHandler.toExtArgumentType().

393  {
394  List<ExtensionFunction.ExtArgumentType> args =
395  new ArrayList<ExtensionFunction.ExtArgumentType>();
396  for (TExtArgumentType atype : udtf.sqlArgTypes) {
397  args.add(toExtArgumentType(atype));
398  }
399  List<ExtensionFunction.ExtArgumentType> outs =
400  new ArrayList<ExtensionFunction.ExtArgumentType>();
401  for (TExtArgumentType otype : udtf.outputArgTypes) {
402  outs.add(toExtArgumentType(otype));
403  }
404  return new ExtensionFunction(args, outs);
405  }
static ExtensionFunction.ExtArgumentType toExtArgumentType(TExtArgumentType type)
+ Here is the call graph for this function:

◆ updateMetadata()

void com.mapd.parser.server.CalciteServerHandler.updateMetadata ( String  catalog,
String  table 
) throws TException
inline

Definition at line 267 of file CalciteServerHandler.java.

References run_benchmark_import.parser, and com.mapd.calcite.parser.MapDParser.updateMetaData().

267  {
268  MAPDLOGGER.debug("Received invalidation from server for " + catalog + " : " + table);
269  long timer = System.currentTimeMillis();
270  callCount++;
271  MapDParser parser;
272  try {
273  parser = (MapDParser) parserPool.borrowObject();
274  } catch (Exception ex) {
275  String msg = "Could not get Parse Item from pool: " + ex.getMessage();
276  MAPDLOGGER.error(msg, ex);
277  return;
278  }
279  CURRENT_PARSER.set(parser);
280  try {
281  parser.updateMetaData(catalog, table);
282  } finally {
283  CURRENT_PARSER.set(null);
284  try {
285  // put parser object back in pool for others to use
286  MAPDLOGGER.debug("Returning object to pool");
287  parserPool.returnObject(parser);
288  } catch (Exception ex) {
289  String msg = "Could not return parse object: " + ex.getMessage();
290  MAPDLOGGER.error(msg, ex);
291  }
292  }
293  }
+ Here is the call graph for this function:

Member Data Documentation

◆ calciteParserFactory

final CalciteParserFactory com.mapd.parser.server.CalciteServerHandler.calciteParserFactory
private

Definition at line 72 of file CalciteServerHandler.java.

◆ callCount

volatile long com.mapd.parser.server.CalciteServerHandler.callCount
private

Definition at line 68 of file CalciteServerHandler.java.

◆ dataDir

String com.mapd.parser.server.CalciteServerHandler.dataDir
private

◆ extSigs

Map<String, ExtensionFunction> com.mapd.parser.server.CalciteServerHandler.extSigs = null
private

Definition at line 82 of file CalciteServerHandler.java.

◆ extSigsJson

final String com.mapd.parser.server.CalciteServerHandler.extSigsJson
private

◆ MAPDLOGGER

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

Definition at line 63 of file CalciteServerHandler.java.

◆ mapdPort

final int com.mapd.parser.server.CalciteServerHandler.mapdPort
private

◆ parserPool

final GenericObjectPool com.mapd.parser.server.CalciteServerHandler.parserPool
private

Definition at line 70 of file CalciteServerHandler.java.

◆ server

TServer com.mapd.parser.server.CalciteServerHandler.server
private

Definition at line 64 of file CalciteServerHandler.java.

◆ skT

SockTransportProperties com.mapd.parser.server.CalciteServerHandler.skT
private

Definition at line 81 of file CalciteServerHandler.java.

◆ udfRTSigs

Map<String, ExtensionFunction> com.mapd.parser.server.CalciteServerHandler.udfRTSigs = null
package

Definition at line 79 of file CalciteServerHandler.java.

◆ udfRTSigsJson

String com.mapd.parser.server.CalciteServerHandler.udfRTSigsJson = ""
private

◆ udfSigsJson

final String com.mapd.parser.server.CalciteServerHandler.udfSigsJson
private

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