OmniSciDB  a5dc49c757
 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  Hash
 
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  RegexpCount
 
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  UrlDecode
 
class  UrlEncode
 
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 129 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 188 of file HeavyDBSqlOperatorTable.java.

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

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

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 198 of file HeavyDBSqlOperatorTable.java.

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

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

+ Here is the caller graph for this function:

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

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

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

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

350  {
351  int suffix_idx = str.indexOf("__");
352  if (suffix_idx == -1) {
353  return str;
354  }
355  assert suffix_idx > 0;
356  return str.substring(0, suffix_idx);
357  }

+ 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 130 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 177 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 185 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: