OmniSciDB  85c2d10cdc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 queryText, java.util.List< TFilterPushDownInfo > thriftFilterPushDownInfo, boolean legacySyntax, boolean isExplain, boolean isViewOptimize, TRestriction restriction) 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, boolean isruntime)
 

Package Functions

void setServer (TServer s)
 

Package Attributes

Map< String, ExtensionFunctionudfRTSigs = null
 
Map< String, ExtensionFunctionudtfSigs = 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 64 of file CalciteServerHandler.java.

Constructor & Destructor Documentation

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

Definition at line 91 of file CalciteServerHandler.java.

References com.mapd.parser.server.CalciteServerHandler.calciteParserFactory, com.mapd.parser.server.CalciteServerHandler.dataDir, com.mapd.parser.server.CalciteServerHandler.extSigs, com.mapd.parser.server.CalciteServerHandler.extSigsJson, com.mapd.parser.server.CalciteServerHandler.mapdPort, and com.mapd.parser.server.CalciteServerHandler.udfSigsJson.

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

Member Function Documentation

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 321 of file CalciteServerHandler.java.

References com.mapd.parser.server.CalciteServerHandler.callCount, com.mapd.parser.server.CalciteServerHandler.hintTypeToThrift(), com.mapd.parser.server.CalciteServerHandler.mapdPort, run_benchmark_import.parser, com.mapd.parser.server.CalciteServerHandler.parserPool, and run_benchmark_import.result.

326  {
327  callCount++;
328  MapDParser parser;
329  try {
330  parser = (MapDParser) parserPool.borrowObject();
331  } catch (Exception ex) {
332  String msg = "Could not get Parse Item from pool: " + ex.getMessage();
333  MAPDLOGGER.error(msg, ex);
334  throw new TException(msg);
335  }
336  MapDUser mapDUser = new MapDUser(user, session, catalog, mapdPort, null);
337  MAPDLOGGER.debug("getCompletionHints was called User: " + user
338  + " Catalog: " + catalog + " sql: " + sql);
339  parser.setUser(mapDUser);
340  CURRENT_PARSER.set(parser);
341 
342  MapDPlanner.CompletionResult completion_result;
343  try {
344  completion_result = parser.getCompletionHints(sql, cursor, visible_tables);
345  } catch (Exception ex) {
346  String msg = "Could not retrieve completion hints: " + ex.getMessage();
347  MAPDLOGGER.error(msg, ex);
348  return new ArrayList<>();
349  } finally {
350  CURRENT_PARSER.set(null);
351  try {
352  // put parser object back in pool for others to use
353  parserPool.returnObject(parser);
354  } catch (Exception ex) {
355  String msg = "Could not return parse object: " + ex.getMessage();
356  MAPDLOGGER.error(msg, ex);
357  throw new InvalidParseRequest(-4, msg);
358  }
359  }
360  List<TCompletionHint> result = new ArrayList<>();
361  for (final SqlMoniker hint : completion_result.hints) {
362  result.add(new TCompletionHint(hintTypeToThrift(hint.getType()),
363  hint.getFullyQualifiedNames(),
364  completion_result.replaced));
365  }
366  return result;
367  }
static TCompletionHintType hintTypeToThrift(final SqlMonikerType type)

+ Here is the call graph for this function:

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

Definition at line 273 of file CalciteServerHandler.java.

273  {
274  return this.extSigsJson;
275  }
String com.mapd.parser.server.CalciteServerHandler.getRuntimeExtensionFunctionWhitelist ( )
inline

Definition at line 283 of file CalciteServerHandler.java.

283  {
284  return this.udfRTSigsJson;
285  }
String com.mapd.parser.server.CalciteServerHandler.getUserDefinedFunctionWhitelist ( )
inline

Definition at line 278 of file CalciteServerHandler.java.

278  {
279  return this.udfSigsJson;
280  }
static TCompletionHintType com.mapd.parser.server.CalciteServerHandler.hintTypeToThrift ( final SqlMonikerType  type)
inlinestaticprivate

Definition at line 544 of file CalciteServerHandler.java.

References COLUMN, SCHEMA, TABLE, and VIEW.

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

544  {
545  switch (type) {
546  case COLUMN:
548  case TABLE:
549  return TCompletionHintType.TABLE;
550  case VIEW:
552  case SCHEMA:
554  case CATALOG:
555  return TCompletionHintType.CATALOG;
556  case REPOSITORY:
557  return TCompletionHintType.REPOSITORY;
558  case FUNCTION:
559  return TCompletionHintType.FUNCTION;
560  case KEYWORD:
561  return TCompletionHintType.KEYWORD;
562  default:
563  return null;
564  }
565  }
#define VIEW
#define COLUMN
#define SCHEMA

+ Here is the caller graph for this function:

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

Definition at line 131 of file CalciteServerHandler.java.

131  {
132  MAPDLOGGER.debug("Ping hit");
133  }
TPlanResult com.mapd.parser.server.CalciteServerHandler.process ( String  user,
String  session,
String  catalog,
String  queryText,
java.util.List< TFilterPushDownInfo >  thriftFilterPushDownInfo,
boolean  legacySyntax,
boolean  isExplain,
boolean  isViewOptimize,
TRestriction  restriction 
) throws InvalidParseRequest, TException
inline

Definition at line 136 of file CalciteServerHandler.java.

References com.mapd.parser.server.CalciteServerHandler.callCount, com.mapd.parser.server.CalciteServerHandler.mapdPort, run_benchmark_import.parser, com.mapd.parser.server.CalciteServerHandler.parserPool, run_benchmark_import.res, run_benchmark_import.result, and toString().

144  {
145  long timer = System.currentTimeMillis();
146  callCount++;
147 
148  MapDParser parser;
149  try {
150  parser = (MapDParser) parserPool.borrowObject();
151  parser.clearMemo();
152  } catch (Exception ex) {
153  String msg = "Could not get Parse Item from pool: " + ex.getMessage();
154  MAPDLOGGER.error(msg, ex);
155  throw new InvalidParseRequest(-1, msg);
156  }
157  Restriction rest = null;
158  if (restriction != null && !restriction.column.isEmpty()) {
159  rest = new Restriction(restriction.column, restriction.values);
160  }
161  MapDUser mapDUser = new MapDUser(user, session, catalog, mapdPort, rest);
162  MAPDLOGGER.debug("process was called User: " + user + " Catalog: " + catalog
163  + " sql: " + queryText);
164  parser.setUser(mapDUser);
165  CURRENT_PARSER.set(parser);
166 
167  // need to trim the sql string as it seems it is not trimed prior to here
168  boolean isRAQuery = false;
169 
170  if (queryText.startsWith("execute calcite")) {
171  queryText = queryText.replaceFirst("execute calcite", "");
172  isRAQuery = true;
173  }
174 
175  queryText = queryText.trim();
176  // remove last charcter if it is a ;
177  if (queryText.length() > 0 && queryText.charAt(queryText.length() - 1) == ';') {
178  queryText = queryText.substring(0, queryText.length() - 1);
179  }
180  String jsonResult;
181  SqlIdentifierCapturer capturer;
182  TAccessedQueryObjects primaryAccessedObjects = new TAccessedQueryObjects();
183  TAccessedQueryObjects resolvedAccessedObjects = new TAccessedQueryObjects();
184  try {
185  final List<MapDParserOptions.FilterPushDownInfo> filterPushDownInfo =
186  new ArrayList<>();
187  for (final TFilterPushDownInfo req : thriftFilterPushDownInfo) {
188  filterPushDownInfo.add(new MapDParserOptions.FilterPushDownInfo(
189  req.input_prev, req.input_start, req.input_next));
190  }
191  MapDParserOptions parserOptions = new MapDParserOptions(
192  filterPushDownInfo, legacySyntax, isExplain, isViewOptimize);
193 
194  if (!isRAQuery) {
195  Pair<String, SqlIdentifierCapturer> res;
196  SqlNode node;
197 
198  res = parser.process(queryText, parserOptions);
199  jsonResult = res.left;
200  capturer = res.right;
201 
202  primaryAccessedObjects.tables_selected_from = new ArrayList<>(capturer.selects);
203  primaryAccessedObjects.tables_inserted_into = new ArrayList<>(capturer.inserts);
204  primaryAccessedObjects.tables_updated_in = new ArrayList<>(capturer.updates);
205  primaryAccessedObjects.tables_deleted_from = new ArrayList<>(capturer.deletes);
206 
207  // also resolve all the views in the select part
208  // resolution of the other parts is not
209  // necessary as these cannot be views
210  resolvedAccessedObjects.tables_selected_from =
211  new ArrayList<>(parser.resolveSelectIdentifiers(capturer));
212  resolvedAccessedObjects.tables_inserted_into = new ArrayList<>(capturer.inserts);
213  resolvedAccessedObjects.tables_updated_in = new ArrayList<>(capturer.updates);
214  resolvedAccessedObjects.tables_deleted_from = new ArrayList<>(capturer.deletes);
215 
216  } else {
217  jsonResult = parser.optimizeRAQuery(queryText, parserOptions);
218  }
219  } catch (SqlParseException ex) {
220  String msg = "SQL Error: " + ex.getMessage();
221  MAPDLOGGER.error(msg);
222  throw new InvalidParseRequest(-2, msg);
223  } catch (org.apache.calcite.tools.ValidationException ex) {
224  String msg = "SQL Error: " + ex.getMessage();
225  if (ex.getCause() != null
226  && (ex.getCause().getClass() == CalciteContextException.class)) {
227  msg = "SQL Error: " + ex.getCause().getMessage();
228  }
229  MAPDLOGGER.error(msg);
230  throw new InvalidParseRequest(-3, msg);
231  } catch (CalciteContextException ex) {
232  String msg = ex.getMessage();
233  MAPDLOGGER.error(msg);
234  throw new InvalidParseRequest(-6, msg);
235  } catch (RelConversionException ex) {
236  String msg = "Failed to generate relational algebra for query " + ex.getMessage();
237  MAPDLOGGER.error(msg, ex);
238  throw new InvalidParseRequest(-5, msg);
239  } catch (Throwable ex) {
240  MAPDLOGGER.error(ex.getClass().toString());
241  String msg = "Exception occurred: " + ex.getMessage();
242  MAPDLOGGER.error(msg, ex);
243  throw new InvalidParseRequest(-4, msg);
244  } finally {
245  CURRENT_PARSER.set(null);
246  try {
247  // put parser object back in pool for others to use
248  parserPool.returnObject(parser);
249  } catch (Exception ex) {
250  String msg = "Could not return parse object: " + ex.getMessage();
251  MAPDLOGGER.error(msg, ex);
252  throw new InvalidParseRequest(-7, msg);
253  }
254  }
255 
256  TPlanResult result = new TPlanResult();
257  result.primary_accessed_objects = primaryAccessedObjects;
258  result.resolved_accessed_objects = resolvedAccessedObjects;
259  result.plan_result = jsonResult;
260  result.execution_time_ms = System.currentTimeMillis() - timer;
261 
262  return result;
263  }
std::string toString(const ExtArgumentType &sig_type)

+ Here is the call graph for this function:

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

Definition at line 370 of file CalciteServerHandler.java.

References com.mapd.parser.server.CalciteServerHandler.extSigs, setup.name, com.mapd.parser.server.CalciteServerHandler.toExtensionFunction(), com.mapd.parser.server.CalciteServerHandler.udfRTSigs, com.mapd.parser.server.CalciteServerHandler.udfRTSigsJson, and com.mapd.parser.server.CalciteServerHandler.udtfSigs.

372  {
373  if (isruntime) {
374  // Clean up previously defined Runtime UDFs
375  if (udfRTSigs != null) {
376  for (String name : udfRTSigs.keySet()) extSigs.remove(name);
377  udfRTSigsJson = "";
378  udfRTSigs.clear();
379  } else {
380  udfRTSigs = new HashMap<String, ExtensionFunction>();
381  }
382 
383  for (TUserDefinedFunction udf : udfs) {
384  udfRTSigs.put(udf.name, toExtensionFunction(udf));
385  }
386 
387  for (TUserDefinedTableFunction udtf : udtfs) {
388  udfRTSigs.put(udtf.name, toExtensionFunction(udtf));
389  }
390 
391  // Avoid overwritting compiled and Loadtime UDFs:
392  for (String name : udfRTSigs.keySet()) {
393  if (extSigs.containsKey(name)) {
394  MAPDLOGGER.error("Extension function `" + name
395  + "` exists. Skipping runtime extenension function with the same name.");
396  udfRTSigs.remove(name);
397  }
398  }
399  // udfRTSigsJson will contain only the signatures of UDFs:
400  udfRTSigsJson = ExtensionFunctionSignatureParser.signaturesToJson(udfRTSigs);
401  // Expose RT UDFs to Calcite server:
402  extSigs.putAll(udfRTSigs);
403  } else {
404  // currently only LoadTime UDTFs can be registered via calcite thrift interface
405  if (udtfSigs == null) {
406  udtfSigs = new HashMap<String, ExtensionFunction>();
407  }
408 
409  for (TUserDefinedTableFunction udtf : udtfs) {
410  udtfSigs.put(udtf.name, toExtensionFunction(udtf));
411  }
412 
413  extSigs.putAll(udtfSigs);
414  }
415 
416  calciteParserFactory.updateOperatorTable();
417  }
string name
Definition: setup.in.py:62
Map< String, ExtensionFunction > udfRTSigs
static ExtensionFunction toExtensionFunction(TUserDefinedFunction udf)

+ Here is the call graph for this function:

void com.mapd.parser.server.CalciteServerHandler.setServer ( TServer  s)
inlinepackage
void com.mapd.parser.server.CalciteServerHandler.shutdown ( ) throws TException
inline

Definition at line 266 of file CalciteServerHandler.java.

266  {
267  // received request to shutdown
268  MAPDLOGGER.debug("Shutdown calcite java server");
269  server.stop();
270  }
static ExtensionFunction.ExtArgumentType com.mapd.parser.server.CalciteServerHandler.toExtArgumentType ( TExtArgumentType  type)
inlinestaticprivate

Definition at line 445 of file CalciteServerHandler.java.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, Bool, ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListInt8, Cursor, Double, Float, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict16, TextEncodingDict32, TextEncodingDict8, TextEncodingNone, run_benchmark_import.type, and Void.

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

446  {
447  switch (type) {
448  case Int8:
449  return ExtensionFunction.ExtArgumentType.Int8;
450  case Int16:
451  return ExtensionFunction.ExtArgumentType.Int16;
452  case Int32:
453  return ExtensionFunction.ExtArgumentType.Int32;
454  case Int64:
455  return ExtensionFunction.ExtArgumentType.Int64;
456  case Float:
457  return ExtensionFunction.ExtArgumentType.Float;
458  case Double:
460  case Void:
461  return ExtensionFunction.ExtArgumentType.Void;
462  case PInt8:
463  return ExtensionFunction.ExtArgumentType.PInt8;
464  case PInt16:
465  return ExtensionFunction.ExtArgumentType.PInt16;
466  case PInt32:
467  return ExtensionFunction.ExtArgumentType.PInt32;
468  case PInt64:
469  return ExtensionFunction.ExtArgumentType.PInt64;
470  case PFloat:
471  return ExtensionFunction.ExtArgumentType.PFloat;
472  case PDouble:
473  return ExtensionFunction.ExtArgumentType.PDouble;
474  case PBool:
475  return ExtensionFunction.ExtArgumentType.PBool;
476  case Bool:
477  return ExtensionFunction.ExtArgumentType.Bool;
478  case ArrayInt8:
479  return ExtensionFunction.ExtArgumentType.ArrayInt8;
480  case ArrayInt16:
481  return ExtensionFunction.ExtArgumentType.ArrayInt16;
482  case ArrayInt32:
483  return ExtensionFunction.ExtArgumentType.ArrayInt32;
484  case ArrayInt64:
485  return ExtensionFunction.ExtArgumentType.ArrayInt64;
486  case ArrayFloat:
487  return ExtensionFunction.ExtArgumentType.ArrayFloat;
488  case ArrayDouble:
489  return ExtensionFunction.ExtArgumentType.ArrayDouble;
490  case ArrayBool:
491  return ExtensionFunction.ExtArgumentType.ArrayBool;
492  case ColumnInt8:
493  return ExtensionFunction.ExtArgumentType.ColumnInt8;
494  case ColumnInt16:
495  return ExtensionFunction.ExtArgumentType.ColumnInt16;
496  case ColumnInt32:
497  return ExtensionFunction.ExtArgumentType.ColumnInt32;
498  case ColumnInt64:
499  return ExtensionFunction.ExtArgumentType.ColumnInt64;
500  case ColumnFloat:
501  return ExtensionFunction.ExtArgumentType.ColumnFloat;
502  case ColumnDouble:
503  return ExtensionFunction.ExtArgumentType.ColumnDouble;
504  case ColumnBool:
505  return ExtensionFunction.ExtArgumentType.ColumnBool;
506  case GeoPoint:
507  return ExtensionFunction.ExtArgumentType.GeoPoint;
508  case GeoLineString:
509  return ExtensionFunction.ExtArgumentType.GeoLineString;
510  case Cursor:
511  return ExtensionFunction.ExtArgumentType.Cursor;
512  case GeoPolygon:
513  return ExtensionFunction.ExtArgumentType.GeoPolygon;
514  case GeoMultiPolygon:
515  return ExtensionFunction.ExtArgumentType.GeoMultiPolygon;
516  case TextEncodingNone:
517  return ExtensionFunction.ExtArgumentType.TextEncodingNone;
518  case TextEncodingDict8:
519  return ExtensionFunction.ExtArgumentType.TextEncodingDict8;
520  case TextEncodingDict16:
521  return ExtensionFunction.ExtArgumentType.TextEncodingDict16;
522  case TextEncodingDict32:
523  return ExtensionFunction.ExtArgumentType.TextEncodingDict32;
524  case ColumnListInt8:
525  return ExtensionFunction.ExtArgumentType.ColumnListInt8;
526  case ColumnListInt16:
527  return ExtensionFunction.ExtArgumentType.ColumnListInt16;
528  case ColumnListInt32:
529  return ExtensionFunction.ExtArgumentType.ColumnListInt32;
530  case ColumnListInt64:
531  return ExtensionFunction.ExtArgumentType.ColumnListInt64;
532  case ColumnListFloat:
533  return ExtensionFunction.ExtArgumentType.ColumnListFloat;
534  case ColumnListDouble:
535  return ExtensionFunction.ExtArgumentType.ColumnListDouble;
536  case ColumnListBool:
537  return ExtensionFunction.ExtArgumentType.ColumnListBool;
538  default:
539  MAPDLOGGER.error("toExtArgumentType: unknown type " + type);
540  return null;
541  }
542  }

+ Here is the caller graph for this function:

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

Definition at line 419 of file CalciteServerHandler.java.

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

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

419  {
420  List<ExtensionFunction.ExtArgumentType> args =
421  new ArrayList<ExtensionFunction.ExtArgumentType>();
422  for (TExtArgumentType atype : udf.argTypes) {
423  final ExtensionFunction.ExtArgumentType arg_type = toExtArgumentType(atype);
424  if (arg_type != ExtensionFunction.ExtArgumentType.Void) {
425  args.add(arg_type);
426  }
427  }
428  return new ExtensionFunction(args, toExtArgumentType(udf.retType));
429  }
static ExtensionFunction.ExtArgumentType toExtArgumentType(TExtArgumentType type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 431 of file CalciteServerHandler.java.

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

431  {
432  List<ExtensionFunction.ExtArgumentType> args =
433  new ArrayList<ExtensionFunction.ExtArgumentType>();
434  for (TExtArgumentType atype : udtf.sqlArgTypes) {
435  args.add(toExtArgumentType(atype));
436  }
437  List<ExtensionFunction.ExtArgumentType> outs =
438  new ArrayList<ExtensionFunction.ExtArgumentType>();
439  for (TExtArgumentType otype : udtf.outputArgTypes) {
440  outs.add(toExtArgumentType(otype));
441  }
442  return new ExtensionFunction(args, outs);
443  }
static ExtensionFunction.ExtArgumentType toExtArgumentType(TExtArgumentType type)

+ Here is the call graph for this function:

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

Definition at line 292 of file CalciteServerHandler.java.

References com.mapd.parser.server.CalciteServerHandler.callCount, run_benchmark_import.parser, com.mapd.parser.server.CalciteServerHandler.parserPool, and test_readcsv.table.

292  {
293  MAPDLOGGER.debug("Received invalidation from server for " + catalog + " : " + table);
294  long timer = System.currentTimeMillis();
295  callCount++;
296  MapDParser parser;
297  try {
298  parser = (MapDParser) parserPool.borrowObject();
299  } catch (Exception ex) {
300  String msg = "Could not get Parse Item from pool: " + ex.getMessage();
301  MAPDLOGGER.error(msg, ex);
302  return;
303  }
304  CURRENT_PARSER.set(parser);
305  try {
306  parser.updateMetaData(catalog, table);
307  } finally {
308  CURRENT_PARSER.set(null);
309  try {
310  // put parser object back in pool for others to use
311  MAPDLOGGER.debug("Returning object to pool");
312  parserPool.returnObject(parser);
313  } catch (Exception ex) {
314  String msg = "Could not return parse object: " + ex.getMessage();
315  MAPDLOGGER.error(msg, ex);
316  }
317  }
318  }

Member Data Documentation

final CalciteParserFactory com.mapd.parser.server.CalciteServerHandler.calciteParserFactory
private
String com.mapd.parser.server.CalciteServerHandler.dataDir
private
Map<String, ExtensionFunction> com.mapd.parser.server.CalciteServerHandler.extSigs = null
private
final String com.mapd.parser.server.CalciteServerHandler.extSigsJson
private
final Logger com.mapd.parser.server.CalciteServerHandler.MAPDLOGGER = LoggerFactory.getLogger(CalciteServerHandler.class)
staticpackage

Definition at line 65 of file CalciteServerHandler.java.

final GenericObjectPool com.mapd.parser.server.CalciteServerHandler.parserPool
private
TServer com.mapd.parser.server.CalciteServerHandler.server
private
SockTransportProperties com.mapd.parser.server.CalciteServerHandler.skT
private

Definition at line 85 of file CalciteServerHandler.java.

Map<String, ExtensionFunction> com.mapd.parser.server.CalciteServerHandler.udfRTSigs = null
package
String com.mapd.parser.server.CalciteServerHandler.udfRTSigsJson = ""
private
final String com.mapd.parser.server.CalciteServerHandler.udfSigsJson
private
Map<String, ExtensionFunction> com.mapd.parser.server.CalciteServerHandler.udtfSigs = null
package

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