OmniSciDB  29e35f4d58
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  SqlArrayValueConstructorAllowingEmpty
 
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 Public Attributes

static final SqlArrayValueConstructorAllowingEmpty ARRAY_VALUE_CONSTRUCTOR
 

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

Constructor & Destructor Documentation

◆ MapDSqlOperatorTable()

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

Definition at line 144 of file MapDSqlOperatorTable.java.

144  {
145  super(ImmutableList.of(parentTable, new CaseInsensitiveListSqlOperatorTable()));
146  listOpTab = (ListSqlOperatorTable) tableList.get(1);
147  }

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

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

155  {
156  listOpTab.add(op);
157  }
+ 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 159 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().

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

246  {
247  int suffix_idx = str.indexOf("__");
248  if (suffix_idx == -1) {
249  return str;
250  }
251  assert suffix_idx > 0;
252  return str.substring(0, suffix_idx - 1);
253  }

Member Data Documentation

◆ ARRAY_VALUE_CONSTRUCTOR

final SqlArrayValueConstructorAllowingEmpty com.mapd.calcite.parser.MapDSqlOperatorTable.ARRAY_VALUE_CONSTRUCTOR
static
Initial value:
=
new SqlArrayValueConstructorAllowingEmpty()

Definition at line 88 of file MapDSqlOperatorTable.java.

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

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

◆ MAPDLOGGER

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

Definition at line 134 of file MapDSqlOperatorTable.java.


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