-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UniqueConstraint is not applied on SQLLens #798
Comments
Thanks @arigaut for reporting the issue and sorry for the late answer. I managed to reproduce it. The unique constraint is correctly added to the lens, but is not used because the datatypes of the lens columns are not known. By turning the following option on ontop.allowRetrievingBlackBoxViewMetadataFromDB = true These datatypes are getting extracted, even if the SQL query in the lens is treated as a "black-box view" as it uses algebra not supported by the current SQL parser. We will discuss internally if it makes sense to turn that option on by default. |
Description
uniqueConstraints
are not applied to a SQLLens. I am using Snowflake as the target warehouse.Steps to Reproduce
Lense
Mapping
SPARQL query
Expected behavior:
An efficient SQL query of the type below:
Actual behavior:
Inefficient query that uses costly DISTINCT operations and self-joins.
Versions
Ontop 5.1.1 as a deployed SPARQL endpoint
The text was updated successfully, but these errors were encountered: