OmniSciDB  a987f07e93
 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  Base64Decode
 
class  Base64Encode
 
class  CastToGeography
 
class  CharLength
 
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  HeavyDB_Geo_PolyBoundsPtr
 
class  HeavyDB_Geo_PolyRenderGroup
 
class  is_point_in_view
 
class  is_point_size_in_view
 
class  KeyForString
 
class  LagInFrame
 
class  LastSample
 
class  LeadInFrame
 
class  LeftRightPad
 
class  LeftRightTrim
 
class  Length
 
class  Likely
 
class  LPad
 
class  LTrim
 
class  MapDAvg
 
class  Mode
 
class  MyUDFFunction
 
class  Now
 
class  nsTimestamp
 
class  OffsetInFragment
 
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_IsEmpty
 
class  ST_IsValid
 
class  ST_Length
 
class  ST_MaxDistance
 
class  ST_NPoints
 
class  ST_NRings
 
class  ST_NumGeometries
 
class  ST_Overlaps
 
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 119 of file HeavyDBSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 178 of file HeavyDBSqlOperatorTable.java.

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

178  {
179  super(ImmutableList.of(parentTable, new CaseInsensitiveListSqlOperatorTable()));
180  listOpTab = (ListSqlOperatorTable) tableList.get(1);
181  }

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

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

188  {
189  listOpTab.add(op);
190  }

+ Here is the caller graph for this function:

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

Definition at line 192 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(), HeavyDB_Geo_PolyRenderGroup(), is_point_in_view(), is_point_size_in_view(), ST_XMax(), ST_XMin(), ST_YMax(), ST_YMin(), and Truncate().

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

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

324  {
325  int suffix_idx = str.indexOf("__");
326  if (suffix_idx == -1) {
327  return str;
328  }
329  assert suffix_idx > 0;
330  return str.substring(0, suffix_idx);
331  }

+ 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 120 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 167 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 175 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: