OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.calcite.parser.HeavyDBSqlOperatorTable Class Reference
+ Inheritance diagram for com.mapd.calcite.parser.HeavyDBSqlOperatorTable:
+ Collaboration diagram for com.mapd.calcite.parser.HeavyDBSqlOperatorTable:

Classes

class  All
 
class  Any
 
class  ApproxCountDistinct
 
class  ApproxMedian
 
class  ApproxPercentile
 
class  ApproxQuantile
 
class  ArrayLength
 
class  BackwardFill
 
class  Base64Decode
 
class  Base64Encode
 
class  CastToGeography
 
class  CharLength
 
class  ConditionalChangeEvent
 
class  convert_meters_to_pixel_height
 
class  convert_meters_to_pixel_width
 
class  CountIf
 
class  Dateadd
 
class  Datediff
 
class  Datepart
 
class  Datetime
 
class  DedupFunction
 
class  EncodeText
 
class  ExtFunction
 
class  ExtTableFunction
 
class  FirstValueInFrame
 
class  ForwardFill
 
class  HeavyDB_Geo_PolyBoundsPtr
 
class  is_point_in_view
 
class  is_point_size_in_view
 
class  JarowinklerSimilarity
 
class  KeyForString
 
class  LagInFrame
 
class  LastSample
 
class  LastValueInFrame
 
class  LeadInFrame
 
class  LeftRightPad
 
class  LeftRightTrim
 
class  Length
 
class  LevenshteinDistance
 
class  Likely
 
class  LPad
 
class  LTrim
 
class  MapDAvg
 
class  MLPredict
 
class  Mode
 
class  MyUDFFunction
 
class  Now
 
class  nsTimestamp
 
class  NthValueInFrame
 
class  OffsetInFragment
 
class  PCAProject
 
class  PgDateTrunc
 
class  PgExtract
 
class  PgILike
 
class  PgUnnest
 
class  RampFunction
 
class  RegexpLike
 
class  RegexpMatch
 
class  RegexpReplace
 
class  RegexpSubstr
 
class  Repeat
 
class  Replace
 
class  Reverse
 
class  RPad
 
class  RTrim
 
class  Sample
 
class  SampleRatio
 
class  Sign
 
class  SplitPart
 
class  SqlArrayValueConstructorAllowingEmpty
 
class  ST_Approx_Overlaps
 
class  ST_Area
 
class  ST_Buffer
 
class  ST_Centroid
 
class  ST_ConcaveHull
 
class  ST_Contains
 
class  ST_ConvexHull
 
class  ST_DFullyWithin
 
class  ST_Difference
 
class  ST_Disjoint
 
class  ST_Distance
 
class  ST_DWithin
 
class  ST_EndPoint
 
class  ST_Equals
 
class  ST_GeogFromText
 
class  ST_GeomFromText
 
class  ST_Intersection
 
class  ST_Intersects
 
class  ST_IntersectsBox
 
class  ST_IsEmpty
 
class  ST_IsValid
 
class  ST_Length
 
class  ST_MaxDistance
 
class  ST_NPoints
 
class  ST_NRings
 
class  ST_NumGeometries
 
class  ST_Perimeter
 
class  ST_Point
 
class  ST_PointN
 
class  ST_SetSRID
 
class  ST_SRID
 
class  ST_StartPoint
 
class  ST_Transform
 
class  ST_Union
 
class  ST_Within
 
class  ST_X
 
class  ST_XMax
 
class  ST_XMin
 
class  ST_Y
 
class  ST_YMax
 
class  ST_YMin
 
class  SumIf
 
class  Truncate
 
class  TryCast
 
class  Unlikely
 
class  usTimestamp
 
class  WidthBucket
 

Public Member Functions

 HeavyDBSqlOperatorTable (SqlOperatorTable parentTable)
 
void addOperator (SqlOperator op)
 
void addUDF (final Map< String, ExtensionFunction > extSigs)
 

Static Public Attributes

static final
SqlArrayValueConstructorAllowingEmpty 
ARRAY_VALUE_CONSTRUCTOR
 
static final SqlFunction TRY_CAST = new TryCast()
 

Static Package Functions

 [static initializer]
 

Static Package Attributes

static final Logger HEAVYDBLOGGER
 

Static Private Member Functions

static String dropSuffix (final String str)
 

Private Attributes

final ListSqlOperatorTable listOpTab
 

Detailed Description

Definition at line 128 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

com.mapd.calcite.parser.HeavyDBSqlOperatorTable.HeavyDBSqlOperatorTable ( SqlOperatorTable  parentTable)
inline

Definition at line 187 of file HeavyDBSqlOperatorTable.java.

References com.mapd.calcite.parser.HeavyDBSqlOperatorTable.listOpTab.

187  {
188  super(ImmutableList.of(parentTable, new CaseInsensitiveListSqlOperatorTable()));
189  listOpTab = (ListSqlOperatorTable) tableList.get(1);
190  }

Member Function Documentation

com.mapd.calcite.parser.HeavyDBSqlOperatorTable.[static initializer] ( )
inlinestaticpackage
void com.mapd.calcite.parser.HeavyDBSqlOperatorTable.addOperator ( SqlOperator  op)
inline

Adds an operator to this table.

Parameters
op

Definition at line 197 of file HeavyDBSqlOperatorTable.java.

Referenced by com.mapd.calcite.parser.HeavyDBSqlOperatorTable.addUDF().

197  {
198  listOpTab.add(op);
199  }

+ Here is the caller graph for this function:

void com.mapd.calcite.parser.HeavyDBSqlOperatorTable.addUDF ( final Map< String, ExtensionFunction extSigs)
inline

Definition at line 201 of file HeavyDBSqlOperatorTable.java.

References com.mapd.calcite.parser.HeavyDBSqlOperatorTable.addOperator(), convert_meters_to_pixel_height(), convert_meters_to_pixel_width(), com.mapd.calcite.parser.HeavyDBSqlOperatorTable.dropSuffix(), HeavyDB_Geo_PolyBoundsPtr(), is_point_in_view(), is_point_size_in_view(), ST_XMax(), ST_XMin(), ST_YMax(), ST_YMin(), and Truncate().

201  {
202  // Don't use anonymous inner classes. They can't be instantiated
203  // using reflection when we are deserializing from JSON.
204  addOperator(new MyUDFFunction());
205  addOperator(new PgUnnest());
206  addOperator(new Any());
207  addOperator(new All());
208  addOperator(new Now());
209  addOperator(new Datetime());
210  addOperator(new PgExtract());
211  addOperator(new Dateadd());
212  addOperator(new Datediff());
213  addOperator(new Datepart());
214  addOperator(new PgDateTrunc());
215  addOperator(new Length());
216  addOperator(new CharLength());
217  addOperator(new KeyForString());
218  addOperator(new SampleRatio());
219  addOperator(new WidthBucket());
220  addOperator(new ArrayLength());
221  addOperator(new PgILike());
222  addOperator(new LTrim());
223  addOperator(new RTrim());
224  addOperator(new LPad());
225  addOperator(new RPad());
226  addOperator(new Replace());
227  addOperator(new Reverse());
228  addOperator(new Repeat());
229  addOperator(new SplitPart());
230  addOperator(new RegexpLike());
231  addOperator(new RegexpReplace());
232  addOperator(new RegexpSubstr());
233  addOperator(new RegexpMatch());
234  addOperator(new Base64Encode());
235  addOperator(new Base64Decode());
236  addOperator(new JarowinklerSimilarity());
237  addOperator(new LevenshteinDistance());
238  addOperator(new Likely());
239  addOperator(new Unlikely());
240  addOperator(new Sign());
241  addOperator(new Truncate());
242  addOperator(new TryCast());
243  addOperator(new ST_IsEmpty());
244  addOperator(new ST_IsValid());
245  addOperator(new ST_Contains());
246  addOperator(new ST_Equals());
247  addOperator(new ST_Intersects());
248  addOperator(new ST_IntersectsBox());
249  addOperator(new ST_Approx_Overlaps());
250  addOperator(new ST_Disjoint());
251  addOperator(new ST_Within());
252  addOperator(new ST_DWithin());
253  addOperator(new ST_DFullyWithin());
254  addOperator(new ST_Distance());
255  addOperator(new ST_MaxDistance());
256  addOperator(new ST_GeogFromText());
257  addOperator(new ST_GeomFromText());
258  addOperator(new ST_Transform());
259  addOperator(new ST_X());
260  addOperator(new ST_Y());
261  addOperator(new ST_XMin());
262  addOperator(new ST_XMax());
263  addOperator(new ST_YMin());
264  addOperator(new ST_YMax());
265  addOperator(new ST_PointN());
266  addOperator(new ST_StartPoint());
267  addOperator(new ST_EndPoint());
268  addOperator(new ST_Length());
269  addOperator(new ST_Perimeter());
270  addOperator(new ST_Area());
271  addOperator(new ST_NPoints());
272  addOperator(new ST_NRings());
273  addOperator(new ST_NumGeometries());
274  addOperator(new ST_SRID());
275  addOperator(new ST_SetSRID());
276  addOperator(new ST_Point());
277  addOperator(new ST_Centroid());
278  addOperator(new ST_Buffer());
279  addOperator(new ST_ConcaveHull());
280  addOperator(new ST_ConvexHull());
281  addOperator(new ST_Intersection());
282  addOperator(new ST_Union());
283  addOperator(new ST_Difference());
284  addOperator(new CastToGeography());
285  addOperator(new EncodeText());
286  addOperator(new OffsetInFragment());
287  addOperator(new ApproxCountDistinct());
288  addOperator(new ApproxMedian());
289  addOperator(new ApproxPercentile());
290  addOperator(new ApproxQuantile());
291  addOperator(new MapDAvg());
292  addOperator(new Mode());
293  addOperator(new Sample());
294  addOperator(new LastSample());
295  addOperator(new ForwardFill());
296  addOperator(new BackwardFill());
297 
298  // window functions on window frame
299  addOperator(new NthValueInFrame());
300  addOperator(new FirstValueInFrame());
301  addOperator(new LastValueInFrame());
302  addOperator(new LagInFrame());
303  addOperator(new LeadInFrame());
304 
305  // conditional window aggregate functions
306  addOperator(new CountIf());
307  addOperator(new SumIf());
308  addOperator(new ConditionalChangeEvent());
309 
315  addOperator(new usTimestamp());
316  addOperator(new nsTimestamp());
317 
318  addOperator(new MLPredict());
319  addOperator(new PCAProject());
320 
321  if (extSigs == null) {
322  return;
323  }
324  HashSet<String> demangledNames = new HashSet<String>();
325  for (Map.Entry<String, ExtensionFunction> extSig : extSigs.entrySet()) {
326  final String demangledName = dropSuffix(extSig.getKey());
327  final String demangledNameArity = extSig.getValue().isTableUdf()
328  ? String.format("%s-%s-%s",
329  demangledName,
330  extSig.getValue().getArgs(),
331  extSig.getValue().getCursorFieldTypes())
332  : String.format("%s-%d", demangledName, extSig.getValue().getArgs().size());
333  if (demangledNames.contains(demangledNameArity)) {
334  continue;
335  }
336  demangledNames.add(demangledNameArity);
337  if (extSig.getValue().isRowUdf()) {
338  addOperator(new ExtFunction(demangledName, extSig.getValue()));
339  } else {
340  addOperator(new ExtTableFunction(demangledName, extSig.getValue()));
341  }
342  }
343  }
EXTENSION_NOINLINE double convert_meters_to_pixel_width(const double meters, int8_t *p, const int64_t psize, const int32_t ic, const int32_t isr, const int32_t osr, const double min_lon, const double max_lon, const int32_t img_width, const double min_width)
EXTENSION_INLINE int64_t HeavyDB_Geo_PolyBoundsPtr(double *bounds, int64_t size)
EXTENSION_NOINLINE double ST_XMax(int8_t *coords, int64_t size, int32_t ic, int32_t isr, int32_t osr)
EXTENSION_NOINLINE bool is_point_size_in_view(int8_t *p, const int64_t psize, const int32_t ic, const double meters, const double min_lon, const double max_lon, const double min_lat, const double max_lat)
EXTENSION_NOINLINE double ST_YMax(int8_t *coords, int64_t size, int32_t ic, int32_t isr, int32_t osr)
EXTENSION_NOINLINE double ST_XMin(int8_t *coords, int64_t size, int32_t ic, int32_t isr, int32_t osr)
EXTENSION_NOINLINE double convert_meters_to_pixel_height(const double meters, int8_t *p, const int64_t psize, const int32_t ic, const int32_t isr, const int32_t osr, const double min_lat, const double max_lat, const int32_t img_height, const double min_height)
EXTENSION_NOINLINE double ST_YMin(int8_t *coords, int64_t size, int32_t ic, int32_t isr, int32_t osr)
EXTENSION_NOINLINE bool is_point_in_view(int8_t *p, const int64_t psize, const int32_t ic, const double min_lon, const double max_lon, const double min_lat, const double max_lat)
EXTENSION_NOINLINE double Truncate(const double x, const int32_t y)

+ Here is the call graph for this function:

static String com.mapd.calcite.parser.HeavyDBSqlOperatorTable.dropSuffix ( final String  str)
inlinestaticprivate

Definition at line 345 of file HeavyDBSqlOperatorTable.java.

Referenced by com.mapd.calcite.parser.HeavyDBSqlOperatorTable.addUDF().

345  {
346  int suffix_idx = str.indexOf("__");
347  if (suffix_idx == -1) {
348  return str;
349  }
350  assert suffix_idx > 0;
351  return str.substring(0, suffix_idx);
352  }

+ Here is the caller graph for this function:

Member Data Documentation

final SqlArrayValueConstructorAllowingEmpty com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ARRAY_VALUE_CONSTRUCTOR
static
Initial value:
=
new SqlArrayValueConstructorAllowingEmpty()

Definition at line 129 of file HeavyDBSqlOperatorTable.java.

Referenced by com.mapd.calcite.parser.HeavyDBParser.rewriteUpdateAsSelect().

final Logger com.mapd.calcite.parser.HeavyDBSqlOperatorTable.HEAVYDBLOGGER
staticpackage
Initial value:
=
LoggerFactory.getLogger(HeavyDBSqlOperatorTable.class)

Definition at line 176 of file HeavyDBSqlOperatorTable.java.

final ListSqlOperatorTable com.mapd.calcite.parser.HeavyDBSqlOperatorTable.listOpTab
private

Mock operator table for testing purposes. Contains the standard SQL operator table, plus a list of operators.

Definition at line 184 of file HeavyDBSqlOperatorTable.java.

Referenced by com.mapd.calcite.parser.HeavyDBSqlOperatorTable.HeavyDBSqlOperatorTable().

final SqlFunction com.mapd.calcite.parser.HeavyDBSqlOperatorTable.TRY_CAST = new TryCast()
static

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