OmniSciDB  c07336695a
com.mapd.calcite.parser.MapDSqlOperatorTable Class Reference
+ Inheritance diagram for com.mapd.calcite.parser.MapDSqlOperatorTable:
+ Collaboration diagram for com.mapd.calcite.parser.MapDSqlOperatorTable:

Classes

class  All
 
class  Any
 
class  ApproxCountDistinct
 
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  ExtFunction
 
class  is_point_in_view
 
class  is_point_size_in_view
 
class  KeyForString
 
class  LastSample
 
class  Length
 
class  Likely
 
class  MapD_GeoPolyBoundsPtr
 
class  MapD_GeoPolyRenderGroup
 
class  MapDAvg
 
class  MyUDFFunction
 
class  Now
 
class  nsTimestamp
 
class  OffsetInFragment
 
class  OmniSci_Geo_PolyBoundsPtr
 
class  OmniSci_Geo_PolyRenderGroup
 
class  PgDateTrunc
 
class  PgExtract
 
class  PgILike
 
class  PgUnnest
 
class  RampFunction
 
class  RegexpLike
 
class  Sample
 
class  Sign
 
class  ST_Area
 
class  ST_Contains
 
class  ST_DFullyWithin
 
class  ST_Disjoint
 
class  ST_Distance
 
class  ST_DWithin
 
class  ST_EndPoint
 
class  ST_GeogFromText
 
class  ST_GeomFromText
 
class  ST_Intersects
 
class  ST_Length
 
class  ST_MaxDistance
 
class  ST_NPoints
 
class  ST_NRings
 
class  ST_Perimeter
 
class  ST_Point
 
class  ST_PointN
 
class  ST_SetSRID
 
class  ST_SRID
 
class  ST_StartPoint
 
class  ST_Transform
 
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
 

Public Member Functions

 MapDSqlOperatorTable (SqlOperatorTable parentTable)
 
void addOperator (SqlOperator op)
 

Static Public Member Functions

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

Static Package Functions

 [static initializer]
 

Static Private Member Functions

static String dropSuffix (final String str)
 

Private Attributes

final ListSqlOperatorTable listOpTab
 

Detailed Description

Author
michael

Definition at line 83 of file MapDSqlOperatorTable.java.

Constructor & Destructor Documentation

◆ MapDSqlOperatorTable()

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

Definition at line 131 of file MapDSqlOperatorTable.java.

131  {
132  super(ImmutableList.of(parentTable, new CaseInsensitiveListSqlOperatorTable()));
133  listOpTab = (ListSqlOperatorTable) tableList.get(1);
134  }

Member Function Documentation

◆ [static initializer]()

com.mapd.calcite.parser.MapDSqlOperatorTable.[static initializer] ( )
inlinestaticpackage

◆ addOperator()

void com.mapd.calcite.parser.MapDSqlOperatorTable.addOperator ( SqlOperator  op)
inline

Adds an operator to this table.

Parameters
op

Definition at line 142 of file MapDSqlOperatorTable.java.

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

142  {
143  listOpTab.add(op);
144  }
+ Here is the caller graph for this function:

◆ addUDF()

static void com.mapd.calcite.parser.MapDSqlOperatorTable.addUDF ( MapDSqlOperatorTable  opTab,
final Map< String, ExtensionFunction extSigs 
)
inlinestatic

Definition at line 146 of file MapDSqlOperatorTable.java.

References com.mapd.calcite.parser.MapDSqlOperatorTable.addOperator(), convert_meters_to_pixel_height(), convert_meters_to_pixel_width(), is_point_in_view(), is_point_size_in_view(), MapD_GeoPolyBoundsPtr(), MapD_GeoPolyRenderGroup(), OmniSci_Geo_PolyBoundsPtr(), OmniSci_Geo_PolyRenderGroup(), ST_NPoints(), ST_NRings(), ST_XMax(), ST_XMin(), ST_YMax(), ST_YMin(), Experimental.String, and Truncate().

Referenced by com.mapd.calcite.parser.MapDParser.createOperatorTable().

147  {
148  // Don't use anonymous inner classes. They can't be instantiated
149  // using reflection when we are deserializing from JSON.
150  // opTab.addOperator(new RampFunction());
151  // opTab.addOperator(new DedupFunction());
152  opTab.addOperator(new MyUDFFunction());
153  opTab.addOperator(new PgUnnest());
154  opTab.addOperator(new Any());
155  opTab.addOperator(new All());
156  opTab.addOperator(new Now());
157  opTab.addOperator(new Datetime());
158  opTab.addOperator(new PgExtract());
159  opTab.addOperator(new Dateadd());
160  opTab.addOperator(new Datediff());
161  opTab.addOperator(new Datepart());
162  opTab.addOperator(new PgDateTrunc());
163  opTab.addOperator(new Length());
164  opTab.addOperator(new CharLength());
165  opTab.addOperator(new KeyForString());
166  opTab.addOperator(new ArrayLength());
167  opTab.addOperator(new PgILike());
168  opTab.addOperator(new RegexpLike());
169  opTab.addOperator(new Likely());
170  opTab.addOperator(new Unlikely());
171  opTab.addOperator(new Sign());
172  opTab.addOperator(new Truncate());
173  opTab.addOperator(new ST_Contains());
174  opTab.addOperator(new ST_Intersects());
175  opTab.addOperator(new ST_Disjoint());
176  opTab.addOperator(new ST_Within());
177  opTab.addOperator(new ST_DWithin());
178  opTab.addOperator(new ST_DFullyWithin());
179  opTab.addOperator(new ST_Distance());
180  opTab.addOperator(new ST_MaxDistance());
181  opTab.addOperator(new ST_GeogFromText());
182  opTab.addOperator(new ST_GeomFromText());
183  opTab.addOperator(new ST_Transform());
184  opTab.addOperator(new ST_X());
185  opTab.addOperator(new ST_Y());
186  opTab.addOperator(new ST_XMin());
187  opTab.addOperator(new ST_XMax());
188  opTab.addOperator(new ST_YMin());
189  opTab.addOperator(new ST_YMax());
190  opTab.addOperator(new ST_PointN());
191  opTab.addOperator(new ST_StartPoint());
192  opTab.addOperator(new ST_EndPoint());
193  opTab.addOperator(new ST_Length());
194  opTab.addOperator(new ST_Perimeter());
195  opTab.addOperator(new ST_Area());
196  opTab.addOperator(new ST_NPoints());
197  opTab.addOperator(new ST_NRings());
198  opTab.addOperator(new ST_SRID());
199  opTab.addOperator(new ST_SetSRID());
200  opTab.addOperator(new ST_Point());
201  opTab.addOperator(new CastToGeography());
202  opTab.addOperator(new OffsetInFragment());
203  opTab.addOperator(new ApproxCountDistinct());
204  opTab.addOperator(new MapDAvg());
205  opTab.addOperator(new Sample());
206  opTab.addOperator(new LastSample());
207  // MapD_Geo* are deprecated in place of the OmniSci_Geo_ varietals
208  opTab.addOperator(new MapD_GeoPolyBoundsPtr());
209  opTab.addOperator(new MapD_GeoPolyRenderGroup());
210  opTab.addOperator(new OmniSci_Geo_PolyBoundsPtr());
211  opTab.addOperator(new OmniSci_Geo_PolyRenderGroup());
212  opTab.addOperator(new convert_meters_to_pixel_width());
213  opTab.addOperator(new convert_meters_to_pixel_height());
214  opTab.addOperator(new is_point_in_view());
215  opTab.addOperator(new is_point_size_in_view());
216  opTab.addOperator(new usTimestamp());
217  opTab.addOperator(new nsTimestamp());
218  if (extSigs == null) {
219  return;
220  }
221  HashSet<String> demangledNames = new HashSet<String>();
222  for (Map.Entry<String, ExtensionFunction> extSig : extSigs.entrySet()) {
223  final String demangledName = dropSuffix(extSig.getKey());
224  if (demangledNames.contains(demangledName)) {
225  continue;
226  }
227  demangledNames.add(demangledName);
228  opTab.addOperator(new ExtFunction(extSig.getKey(), extSig.getValue()));
229  }
230  }
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 int32_t OmniSci_Geo_PolyRenderGroup(int32_t render_group)
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_INLINE int32_t MapD_GeoPolyRenderGroup(int32_t render_group)
EXTENSION_INLINE int64_t OmniSci_Geo_PolyBoundsPtr(double *bounds, int64_t size)
EXTENSION_NOINLINE double ST_YMin(int8_t *coords, int64_t size, int32_t ic, int32_t isr, int32_t osr)
EXTENSION_INLINE int64_t MapD_GeoPolyBoundsPtr(double *bounds, int64_t size)
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_INLINE int32_t ST_NRings(int32_t *poly_ring_sizes, int64_t poly_num_rings)
EXTENSION_NOINLINE double Truncate(const double x, const int32_t y)
EXTENSION_INLINE int32_t ST_NPoints(int8_t *coords, int64_t coords_sz, int32_t ic)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dropSuffix()

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

Definition at line 232 of file MapDSqlOperatorTable.java.

232  {
233  int suffix_idx = str.indexOf("__");
234  if (suffix_idx == -1) {
235  return str;
236  }
237  assert suffix_idx > 0;
238  return str.substring(0, suffix_idx - 1);
239  }

Member Data Documentation

◆ listOpTab

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

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

Definition at line 128 of file MapDSqlOperatorTable.java.


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