the test code is :
public class HrSchema2{
public List<Employee> emps = new ArrayList<Employee>();
public HrSchema2() {
}
}
public final String sql = "select count(e.empid) from hr.emps as e";
Class.forName("org.apache.calcite.jdbc.Driver");
Properties info = new Properties();
info.setProperty("lex", "JAVA");
try {
Connection connection =
DriverManager.getConnection("jdbc:calcite:", info);
CalciteConnection calciteConnection =
connection.unwrap(CalciteConnection.class);
SchemaPlus rootSchema = calciteConnection.getRootSchema();
Schema schema = new ReflectiveSchema(new HrSchema2());
rootSchema.add("hr", schema);
Statement statement = calciteConnection.createStatement();
ResultSet resultSet = statement.executeQuery(sql);
//print(resultSet);
resultSet.close();
statement.close();
connection.close();
}catch(Exception ex) {
ex.printStackTrace();
}
we got the following error:
java.sql.SQLException: Error while executing SQL "select count(e.empid) from hr.emps as e": From line 1, column 16 to line 1, column 20: Column 'empid' not found in table 'e'
goodbye from test runner