def visit_select(self, select, **kwargs): if select._offset_clause: raise exceptions.NotSupportedError( 'Offset clause is not supported in pinot') top = None # Pinot does not support orderby-limit for aggregating queries, replace that with # top keyword. (The order by info is lost since the result is always ordered-desc by the group values) if select._group_by_clause is not None: logger.debug( f'Query {select} has metrics, so rewriting its order-by/limit clauses to just top' ) top = 100 if select._limit_clause is not None: if select._simple_int_limit: top = select._limit else: raise exceptions.NotSupportedError( 'Only simple integral limits are supported in pinot') select._limit_clause = None select._order_by_clause = elements.ClauseList() return super().visit_select(select, **kwargs) + \ (f'\nTOP {top}' if top is not None else '')
def executemany(self, operation, seq_of_parameters=None): raise exceptions.NotSupportedError( '`executemany` is not supported, use `execute` instead')
def visit_BINARY(self, type_, **kwargs): raise exceptions.NotSupportedError('Type BINARY is not supported')
def visit_TIME(self, type_, **kwargs): raise exceptions.NotSupportedError('Type TIME is not supported')
def visit_NCLOB(self, type_, **kwargs): raise exceptions.NotSupportedError('Type NCBLOB is not supported')
def visit_CLOB(self, type_, **kwargs): raise exceptions.NotSupportedError("Type CBLOB is not supported")
def visit_VARBINARY(self, type_, **kwargs): raise exceptions.NotSupportedError("Type VARBINARY is not supported")
def visit_DATETIME(self, type_, **kwargs): raise exceptions.NotSupportedError("Type DATETIME is not supported")