OmniSciDB  4201147b46
 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  CastToGeography
 
class  CharLength
 
class  convert_meters_to_pixel_height
 
class  convert_meters_to_pixel_width
 
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  LastSample
 
class  LeftRightPad
 
class  LeftRightTrim
 
class  Length
 
class  Likely
 
class  LPad
 
class  LTrim
 
class  MapDAvg
 
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_Contains
 
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_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  Truncate
 
class  Unlikely
 
class  usTimestamp
 
class  WidthBucket
 

Public Member Functions

 HeavyDBSqlOperatorTable (SqlOperatorTable parentTable)
 
void addOperator (SqlOperator op)
 

Static Public Member Functions

static void addUDF (HeavyDBSqlOperatorTable opTab, final Map< String, ExtensionFunction > extSigs)
 

Static Public Attributes

static final
SqlArrayValueConstructorAllowingEmpty 
ARRAY_VALUE_CONSTRUCTOR
 

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

Constructor & Destructor Documentation

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

Definition at line 160 of file HeavyDBSqlOperatorTable.java.

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

160  {
161  super(ImmutableList.of(parentTable, new CaseInsensitiveListSqlOperatorTable()));
162  listOpTab = (ListSqlOperatorTable) tableList.get(1);
163  }

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

170  {
171  listOpTab.add(op);
172  }
static void com.mapd.calcite.parser.HeavyDBSqlOperatorTable.addUDF ( HeavyDBSqlOperatorTable  opTab,
final Map< String, ExtensionFunction extSigs 
)
inlinestatic

Definition at line 174 of file HeavyDBSqlOperatorTable.java.

References 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().

175  {
176  // Don't use anonymous inner classes. They can't be instantiated
177  // using reflection when we are deserializing from JSON.
178  // opTab.addOperator(new RampFunction());
179  // opTab.addOperator(new DedupFunction());
180  opTab.addOperator(new MyUDFFunction());
181  opTab.addOperator(new PgUnnest());
182  opTab.addOperator(new Any());
183  opTab.addOperator(new All());
184  opTab.addOperator(new Now());
185  opTab.addOperator(new Datetime());
186  opTab.addOperator(new PgExtract());
187  opTab.addOperator(new Dateadd());
188  opTab.addOperator(new Datediff());
189  opTab.addOperator(new Datepart());
190  opTab.addOperator(new PgDateTrunc());
191  opTab.addOperator(new Length());
192  opTab.addOperator(new CharLength());
193  opTab.addOperator(new KeyForString());
194  opTab.addOperator(new SampleRatio());
195  opTab.addOperator(new WidthBucket());
196  opTab.addOperator(new ArrayLength());
197  opTab.addOperator(new PgILike());
198  opTab.addOperator(new LTrim());
199  opTab.addOperator(new RTrim());
200  opTab.addOperator(new LPad());
201  opTab.addOperator(new RPad());
202  opTab.addOperator(new Replace());
203  opTab.addOperator(new Reverse());
204  opTab.addOperator(new Repeat());
205  opTab.addOperator(new SplitPart());
206  opTab.addOperator(new RegexpLike());
207  opTab.addOperator(new RegexpReplace());
208  opTab.addOperator(new RegexpSubstr());
209  opTab.addOperator(new RegexpMatch());
210  opTab.addOperator(new Likely());
211  opTab.addOperator(new Unlikely());
212  opTab.addOperator(new Sign());
213  opTab.addOperator(new Truncate());
214  opTab.addOperator(new ST_IsEmpty());
215  opTab.addOperator(new ST_IsValid());
216  opTab.addOperator(new ST_Contains());
217  opTab.addOperator(new ST_Equals());
218  opTab.addOperator(new ST_Intersects());
219  opTab.addOperator(new ST_Overlaps());
220  opTab.addOperator(new ST_Approx_Overlaps());
221  opTab.addOperator(new ST_Disjoint());
222  opTab.addOperator(new ST_Within());
223  opTab.addOperator(new ST_DWithin());
224  opTab.addOperator(new ST_DFullyWithin());
225  opTab.addOperator(new ST_Distance());
226  opTab.addOperator(new ST_MaxDistance());
227  opTab.addOperator(new ST_GeogFromText());
228  opTab.addOperator(new ST_GeomFromText());
229  opTab.addOperator(new ST_Transform());
230  opTab.addOperator(new ST_X());
231  opTab.addOperator(new ST_Y());
232  opTab.addOperator(new ST_XMin());
233  opTab.addOperator(new ST_XMax());
234  opTab.addOperator(new ST_YMin());
235  opTab.addOperator(new ST_YMax());
236  opTab.addOperator(new ST_PointN());
237  opTab.addOperator(new ST_StartPoint());
238  opTab.addOperator(new ST_EndPoint());
239  opTab.addOperator(new ST_Length());
240  opTab.addOperator(new ST_Perimeter());
241  opTab.addOperator(new ST_Area());
242  opTab.addOperator(new ST_NPoints());
243  opTab.addOperator(new ST_NRings());
244  opTab.addOperator(new ST_SRID());
245  opTab.addOperator(new ST_SetSRID());
246  opTab.addOperator(new ST_Point());
247  opTab.addOperator(new ST_Centroid());
248  opTab.addOperator(new ST_Buffer());
249  opTab.addOperator(new ST_Intersection());
250  opTab.addOperator(new ST_Union());
251  opTab.addOperator(new ST_Difference());
252  opTab.addOperator(new CastToGeography());
253  opTab.addOperator(new EncodeText());
254  opTab.addOperator(new OffsetInFragment());
255  opTab.addOperator(new ApproxCountDistinct());
256  opTab.addOperator(new ApproxMedian());
257  opTab.addOperator(new ApproxPercentile());
258  opTab.addOperator(new ApproxQuantile());
259  opTab.addOperator(new MapDAvg());
260  opTab.addOperator(new Sample());
261  opTab.addOperator(new LastSample());
262  opTab.addOperator(new HeavyDB_Geo_PolyBoundsPtr());
263  opTab.addOperator(new HeavyDB_Geo_PolyRenderGroup());
264  opTab.addOperator(new convert_meters_to_pixel_width());
265  opTab.addOperator(new convert_meters_to_pixel_height());
266  opTab.addOperator(new is_point_in_view());
267  opTab.addOperator(new is_point_size_in_view());
268  opTab.addOperator(new usTimestamp());
269  opTab.addOperator(new nsTimestamp());
270  if (extSigs == null) {
271  return;
272  }
273  HashSet<String> demangledNames = new HashSet<String>();
274  for (Map.Entry<String, ExtensionFunction> extSig : extSigs.entrySet()) {
275  final String demangledName = dropSuffix(extSig.getKey());
276  final String demangledNameArity =
277  String.format("%s-%d", demangledName, extSig.getValue().getArgs().size());
278  if (demangledNames.contains(demangledNameArity)) {
279  continue;
280  }
281  demangledNames.add(demangledNameArity);
282  if (extSig.getValue().isRowUdf()) {
283  opTab.addOperator(new ExtFunction(demangledName, extSig.getValue()));
284  } else {
285  opTab.addOperator(new ExtTableFunction(demangledName, extSig.getValue()));
286  }
287  }
288  }
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 290 of file HeavyDBSqlOperatorTable.java.

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

290  {
291  int suffix_idx = str.indexOf("__");
292  if (suffix_idx == -1) {
293  return str;
294  }
295  assert suffix_idx > 0;
296  return str.substring(0, suffix_idx);
297  }

+ 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 103 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 149 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 157 of file HeavyDBSqlOperatorTable.java.

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


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