Dear Erin ~ You are right, Calcite now always hard code the parser config for JDBC query[1], that means, Lex config for view expanding is not supported yet, can you log a issue and probably fire a patch to support that?
[1] https://github.com/apache/calcite/blob/ab136b5f76a4cb951e847fcba6b414c5e80dbbe6/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java#L385 Best, Danny Chan 在 2019年12月2日 +0800 AM4:19,Erin Drummond <[email protected]>,写道: > Hello, > > I am currently attempting to test out the views feature of Calcite. > > I am using a connection string like so: > jdbc:calcite:lex=JAVA;model=inline:<json model> > > I have created a JdbcSchema that is attached to an actual database - lets > call it "t1". I can successfully run the query "select * from t1.table > limit 10" > > I then created another schema, defined like so: > { > "name": "viewtest", > "tables": [ > { "name": "test_view", "type": "view", "sql": "select * from > t1.table limit 10" } > ] > } > > The idea is to set up connections to a bunch of physical data sources and > then have a "views" schema that just contains views over them. > > However, when attempting to run the query "select * from > viewtest.test_view", I get the following exception: > > StatementCallback; uncategorized SQLException for SQL [select * from > viewtest.test_view]; SQL state [null]; error code [0]; > Error while executing SQL \"select * from viewtest.test_view\": From line > 1, column 15 to line 1, column 32: Object 'T1' not found; did you mean 't1'? > > I can clearly see that lex=JAVA is not being used for the view and the > default lex=ORACLE is being used. If I change the view SQL to 'select * > from "t1".table limit 10' it works - but I don't want to have to quote the > identifiers oracle style, I would like the lex=JAVA that I specified on the > connection string to flow down to views as well. > > What am I missing here? > > Cheers, > Erin
