Hi Feng,

You’re right, i get the same result with your suggestion, and either of the 
following expressions is ok.


1. properties.put(CalciteConnectionProperty.LEX.camelName(), "MYSQL");
2. properties.put("lex", "MYSQL");




You’re familiar with Calcite :), and thanks for your help and kindness! ☺


Actually, we plan to develop a new feature, and i find Calcite is a great 
option to meet our demand.


Thanks Calcite community, and hope two communities can build deeper connection.


P.S
Apache ShardingSphere(Incubator) is an open-source ecosystem consisted of a set 
of distributed database middleware solutions.




| |
Juan Pan
|
|
panj...@apache.org
Juan Pan(Trista), Apache ShardingSphere
|


On 09/12/2019 17:32,Feng Zhu<wellfeng...@gmail.com> wrote:
Hi, Juan Pan:
You may find the logic in *UnregisterDriver#connect(String url, Properties
info)*
It just parses the key-value pairs in url's prefix and adds into the copy
of "info".
Therefore, I think the below config
*properties.put(CalciteConnecti**onProperty.LEX, Lex.MYSQL); *
should be aligned with your first usage:
*properties.put("lex", "MYSQL"); *

Juan Pan <panj...@apache.org> 于2019年9月12日周四 下午2:23写道:







Hi Feng,




Thanks for your promote reply. :)




Lex is just what i want. But when i tried to use it, i encountered another
problem.




The first usage is ok, but the second one doesn’t work. ThoughLex are used
in different methods, the result will be same, i think. Do i misunderstand?
Or is the second one wrong usage?




The first usage:




CONNECTION_URL = "jdbc:calcite:lex=MYSQL;model=xxxx"

try (Connection connection = DriverManager.getConnection(CONNECTION_URL);

Statement statement = connection.createStatement()) {

// do some things

}




The second usage:




CONNECTION_URL = "jdbc:calcite:model="

Properties properties = new Properties();

properties.put(CalciteConnectionProperty.LEX, Lex.MYSQL);

try (Connection connection = DriverManager.getConnection(CONNECTION_URL,
properties);

Statement statement = connection.createStatement()) {

// do some things

}




Thanks again for your kindness, and waiting  for u. :)




Regards,

Trista





| |
Juan Pan
|
|
panj...@apache.org
Juan Pan(Trista), Apache ShardingSphere
|


On 09/11/2019 20:23,Feng Zhu<wellfeng...@gmail.com> wrote:
Hi, JuanPan,
You can refer to Lex, which decides how identifiers are quoted, whether
they are converted to upper-case
org.apache.calcite.config.Lex

Regards

Juan Pan <panj...@apache.org> 于2019年9月11日周三 下午8:05写道:



Hi, all the committers and contributors,


This email is for your help.


I am now deep in Apache Calcite, and it’s great. Now, i want to know
whether it is possible that unquoted identifiers are not implicitly
converted to upper case?


For example, a SQL is `select name from test`, when it was executed, an
exception is thrown:


org.apache.calcite.sql.validate.SqlValidatorException: Object 'TEST' not
found within 'memory'; did you mean 'test’?


I wonder there is any setting that can make `name` and `test`  recognized
correctly by Calcite without double quotes.


Thanks for your help.


Regards,
Trista
-------------------------------------------------------
Email:panj...@apache.org
Juan Pan(Trista) Apache ShardingSphere



Reply via email to