How to avoid inconsistency with syntax of OpenLink Virtuoso SQL in Apache Superset

54 Views Asked by At

In Apache Superset if OpenLink Virtuoso database is used (ODBC driver + Alchemy dialect), the following error is displayed for any SQL query: enter image description here

That's because Apache Superset automatically adds LIMIT clause to any SQL statement from SQL Lab, but Virtuoso SQL does not support LIMIT clause in SQL statements. (Virtuoso uses TOP.)

For example, such initial SQL statement in SQL Lab

SELECT TOP 3 count(*) FROM DBA.VALUE_FACT 

is received by Virtuoso ODBC driver as follows:

SQL = [SELECT TOP 3 count(*) FROM DBA.VALUE_FACT
LIMIT 101][length = 51]

Is there a way to fix that problem by configuration changes in Superset?

It may be curious to know that SPARQL queries (which start with keyword SPARQL) are working fairly well in SQL Lab.

1

There are 1 best solutions below

0
TallTed On

There are others who want to disable that LIMIT clause in Superset. It doesn't appear possible, yet (but add your name to the list!).

I would suggest you also request that Virtuoso add support for LIMIT/OFFSET in its SQL dialect, as it already supports LIMIT/OFFSET in SPARQL ... which would explain why the SPASQL (SPARQL-in-SQL) queries are working in Superset.