OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  RowCopier
 
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 Package Attributes

static final Logger MAPDLOGGER = LoggerFactory.getLogger(MapDSqlOperatorTable.class)
 

Static Private Member Functions

static String dropSuffix (final String str)
 

Private Attributes

final ListSqlOperatorTable listOpTab
 

Detailed Description

Author
michael

Definition at line 85 of file MapDSqlOperatorTable.java.

Constructor & Destructor Documentation

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

Definition at line 135 of file MapDSqlOperatorTable.java.

References com.mapd.calcite.parser.MapDSqlOperatorTable.listOpTab.

135  {
136  super(ImmutableList.of(parentTable, new CaseInsensitiveListSqlOperatorTable()));
137  listOpTab = (ListSqlOperatorTable) tableList.get(1);
138  }

Member Function Documentation

com.mapd.calcite.parser.MapDSqlOperatorTable.[static initializer] ( )
inlinestaticpackage
void com.mapd.calcite.parser.MapDSqlOperatorTable.addOperator ( SqlOperator  op)
inline

Adds an operator to this table.

Parameters
op

Definition at line 146 of file MapDSqlOperatorTable.java.

146  {
147  listOpTab.add(op);
148  }
static void com.mapd.calcite.parser.MapDSqlOperatorTable.addUDF ( MapDSqlOperatorTable  opTab,
final Map< String, ExtensionFunction extSigs 
)
inlinestatic

Definition at line 150 of file MapDSqlOperatorTable.java.

References convert_meters_to_pixel_height(), convert_meters_to_pixel_width(), com.mapd.calcite.parser.MapDSqlOperatorTable.dropSuffix(), 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().

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

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

Definition at line 237 of file MapDSqlOperatorTable.java.

References assert().

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

237  {
238  int suffix_idx = str.indexOf("__");
239  if (suffix_idx == -1) {
240  return str;
241  }
242  assert suffix_idx > 0;
243  return str.substring(0, suffix_idx - 1);
244  }
int64_t const int32_t sz assert(dest)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

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 132 of file MapDSqlOperatorTable.java.

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

final Logger com.mapd.calcite.parser.MapDSqlOperatorTable.MAPDLOGGER = LoggerFactory.getLogger(MapDSqlOperatorTable.class)
staticpackage

Definition at line 125 of file MapDSqlOperatorTable.java.


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