OmniSciDB  f17484ade4
 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  KeyForString
 
class  LagInFrame
 
class  LastSample
 
class  LastValueInFrame
 
class  LeadInFrame
 
class  LeftRightPad
 
class  LeftRightTrim
 
class  Length
 
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 Likely());
237  addOperator(new Unlikely());
238  addOperator(new Sign());
239  addOperator(new Truncate());
240  addOperator(new TryCast());
241  addOperator(new ST_IsEmpty());
242  addOperator(new ST_IsValid());
243  addOperator(new ST_Contains());
244  addOperator(new ST_Equals());
245  addOperator(new ST_Intersects());
246  addOperator(new ST_IntersectsBox());
247  addOperator(new ST_Approx_Overlaps());
248  addOperator(new ST_Disjoint());
249  addOperator(new ST_Within());
250  addOperator(new ST_DWithin());
251  addOperator(new ST_DFullyWithin());
252  addOperator(new ST_Distance());
253  addOperator(new ST_MaxDistance());
254  addOperator(new ST_GeogFromText());
255  addOperator(new ST_GeomFromText());
256  addOperator(new ST_Transform());
257  addOperator(new ST_X());
258  addOperator(new ST_Y());
259  addOperator(new ST_XMin());
260  addOperator(new ST_XMax());
261  addOperator(new ST_YMin());
262  addOperator(new ST_YMax());
263  addOperator(new ST_PointN());
264  addOperator(new ST_StartPoint());
265  addOperator(new ST_EndPoint());
266  addOperator(new ST_Length());
267  addOperator(new ST_Perimeter());
268  addOperator(new ST_Area());
269  addOperator(new ST_NPoints());
270  addOperator(new ST_NRings());
271  addOperator(new ST_NumGeometries());
272  addOperator(new ST_SRID());
273  addOperator(new ST_SetSRID());
274  addOperator(new ST_Point());
275  addOperator(new ST_Centroid());
276  addOperator(new ST_Buffer());
277  addOperator(new ST_ConcaveHull());
278  addOperator(new ST_ConvexHull());
279  addOperator(new ST_Intersection());
280  addOperator(new ST_Union());
281  addOperator(new ST_Difference());
282  addOperator(new CastToGeography());
283  addOperator(new EncodeText());
284  addOperator(new OffsetInFragment());
285  addOperator(new ApproxCountDistinct());
286  addOperator(new ApproxMedian());
287  addOperator(new ApproxPercentile());
288  addOperator(new ApproxQuantile());
289  addOperator(new MapDAvg());
290  addOperator(new Mode());
291  addOperator(new Sample());
292  addOperator(new LastSample());
293  addOperator(new ForwardFill());
294  addOperator(new BackwardFill());
295 
296  // window functions on window frame
297  addOperator(new NthValueInFrame());
298  addOperator(new FirstValueInFrame());
299  addOperator(new LastValueInFrame());
300  addOperator(new LagInFrame());
301  addOperator(new LeadInFrame());
302 
303  // conditional window aggregate functions
304  addOperator(new CountIf());
305  addOperator(new SumIf());
306  addOperator(new ConditionalChangeEvent());
307 
313  addOperator(new usTimestamp());
314  addOperator(new nsTimestamp());
315 
316  addOperator(new MLPredict());
317  addOperator(new PCAProject());
318 
319  if (extSigs == null) {
320  return;
321  }
322  HashSet<String> demangledNames = new HashSet<String>();
323  for (Map.Entry<String, ExtensionFunction> extSig : extSigs.entrySet()) {
324  final String demangledName = dropSuffix(extSig.getKey());
325  final String demangledNameArity = extSig.getValue().isTableUdf()
326  ? String.format("%s-%s-%s",
327  demangledName,
328  extSig.getValue().getArgs(),
329  extSig.getValue().getCursorFieldTypes())
330  : String.format("%s-%d", demangledName, extSig.getValue().getArgs().size());
331  if (demangledNames.contains(demangledNameArity)) {
332  continue;
333  }
334  demangledNames.add(demangledNameArity);
335  if (extSig.getValue().isRowUdf()) {
336  addOperator(new ExtFunction(demangledName, extSig.getValue()));
337  } else {
338  addOperator(new ExtTableFunction(demangledName, extSig.getValue()));
339  }
340  }
341  }
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 343 of file HeavyDBSqlOperatorTable.java.

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

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

+ 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: