zkaoudi opened a new issue, #677:
URL: https://github.com/apache/wayang/issues/677

   In the executeSql() method of the SqlContext the configuration file is not 
being passed.
   In line: 
https://github.com/apache/wayang/blob/6172a5f464f5feb3e16f2fdbd52a63584ad2b861/wayang-api/wayang-api-sql/src/main/java/org/apache/wayang/api/sql/context/SqlContext.java#L193
   maybe we should use optimizer.convertWithConfig(...) instead of 
optimizer.convert(..)
   
   This is required for the modelParser in line 
   
https://github.com/apache/wayang/blob/6172a5f464f5feb3e16f2fdbd52a63584ad2b861/wayang-api/wayang-api-sql/src/main/java/org/apache/wayang/api/sql/calcite/converter/WayangTableScanVisitor.java#L58
   
   If the configuration is not passed it assumes a default model json file 
which does not exist and gives this error:
   
   
   java.nio.file.NoSuchFileException: 
wayang-api/wayang-api-sql/src/main/resources/model.json
        at 
java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
        at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at 
java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
        at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
        at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
        at java.base/java.nio.file.Files.readAllBytes(Files.java:3288)
        at java.base/java.nio.file.Files.readString(Files.java:3366)
        at java.base/java.nio.file.Files.readString(Files.java:3325)
        at 
org.apache.wayang.api.sql.calcite.utils.ModelParser.<init>(ModelParser.java:42)
        at 
org.apache.wayang.api.sql.calcite.converter.WayangTableScanVisitor.visit(WayangTableScanVisitor.java:59)
        at 
org.apache.wayang.api.sql.calcite.converter.WayangRelConverter.convert(WayangRelConverter.java:54)
        at 
org.apache.wayang.api.sql.calcite.optimizer.Optimizer.convert(Optimizer.java:222)
        at 
org.apache.wayang.api.sql.context.SqlContext.executeSql(SqlContext.java:218)
        at org.examples.wayang.QueryWithSQL.main(QueryWithSQL.java:60)
   Exception in thread "main" java.lang.IllegalArgumentException: Could not 
initialize calcite model parser from current Wayang configuration
        at 
org.apache.wayang.api.sql.calcite.converter.WayangTableScanVisitor.visit(WayangTableScanVisitor.java:63)
        at 
org.apache.wayang.api.sql.calcite.converter.WayangRelConverter.convert(WayangRelConverter.java:54)
        at 
org.apache.wayang.api.sql.calcite.optimizer.Optimizer.convert(Optimizer.java:222)
        at 
org.apache.wayang.api.sql.context.SqlContext.executeSql(SqlContext.java:218)
        at org.examples.wayang.QueryWithSQL.main(QueryWithSQL.java:60)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to