Hi,
I'm investigating using ontop-cli-4.2.1 as an R2RML mapper for a DB2 database.
At the moment the materialize function is failing with a SQLException caused by the query extension being generated for a different (default?) SQL dialect (casting the subject column to an unsized VARCHAR).
I've had a quick check of the code, the VARCHAR mapping looks correct in class
DB2SQLDialectAdpater so I am wondering if there is something that I need to configure.
Could someone tell me how I can fix the dialect issue please?
Many thanks,
Details (unable to files load to Google docs from behind company firewall)
Properties file:
jdbc.driver=com.ibm.db2.jcc.DB2Driver
ontop.queryLogging=True
ontop.testMode=True
Mapping file excerpt:
Generated query, invalid generated statement in red
08:34:10.399 |-DEBUG in i.u.i.o.a.r.impl.QuestQueryProcessor - Resulting native query:
ans1(s,g)
CONSTRUCT [s, g] [s/RDF(
http://example.com/Partner/Adresse/{}(v0),IRI), g/NULL]
NATIVE [v0]
SELECT DISTINCT
CAST(V1.ADRESSNUMMER AS VARCHAR) AS "v0"
FROM (SELECT DISTINCT
ADRESSNUMMER ,
CAST(PLZ4 AS VARCHAR(10)) AS PLZ4,
HAUSNUMMER
FROM DB2ZVIEW.RDFPARTNER4POC
WHERE ADRESSNUMMER = 100
LIMIT 1) V1
WHERE V1.ADRESSNUMMER IS NOT NULL
Stack trace:
08:34:10.402 |-DEBUG in i.u.i.o.a.c.impl.QuestStatement - Executing the query and get the result...
08:34:10.518 |-ERROR in i.u.i.o.a.c.impl.QuestStatement - com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-604, SQLSTATE=42611, SQLERRMC=null, DRIVER=4.26.14
it.unibz.inf.ontop.exception.OntopQueryEvaluationException: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-604, SQLSTATE=42611, SQLERRMC=null, DRIVER=4.26.14
at it.unibz.inf.ontop.answering.connection.impl.SQLQuestStatement.executeSelectQuery(SQLQuestStatement.java:202)
at it.unibz.inf.ontop.answering.connection.impl.QuestStatement.executeSelectQuery(QuestStatement.java:122)
at it.unibz.inf.ontop.answering.connection.impl.QuestStatement.executeSelectQuery(QuestStatement.java:114)
at it.unibz.inf.ontop.answering.connection.impl.QuestStatement$QueryExecutionThread.run(QuestStatement.java:97)
Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-604, SQLSTATE=42611, SQLERRMC=null, DRIVER=4.26.14
at com.ibm.db2.jcc.am.b7.a(b7.java:810)