RaigorJiang opened a new issue, #18811:
URL: https://github.com/apache/shardingsphere/issues/18811

   Hi community,
   
   Since the release of version 5.0.0, DistSQL has provided users with powerful 
management capabilities. 
   However, DistSQL lacks something compared to standard SQL statements: data 
type specifications.
   
   What does that mean?
   
   Let's look at this DistSQL:
   ```sql
   ADD RESOURCE resource_0 (
       HOST=127.0.0.1,
       PORT=3306,
       DB=db0,
       USER=root,
       PASSWORD=root,
       PROPERTIES("maximumPoolSize"=10,"idleTimeout"="30000")
   )
   ````
   - `127.0.0.1` should be a string, why don't we need quotes?
   - `root` for USER and PASSWORD are both strings, so why don't quotes are 
needed?
   - Why is there no quotes for `10` in PROPERTIES and quotes for `"30000"`?
   
   
   
   Look at the next DistSQL:
   ```sql
   CREATE SHARDING ALGORITHM table_inline (
   TYPE(NAME=inline,PROPERTIES("algorithm-expression"="t_order_${order_id % 
2}"))
   );
   ```
   - `NAME=inline`, where inline is a string without quotes
   - `t_order_${order_id % 2}` is also a string, but must have quotes
   
   As can be seen from the above, in order to reduce user input, DistSQL 
ignores some quotes requirements, but this creates confusion for users because 
they are not sure where quotes are required and where they can be omitted.
   
   Therefore, we need to sort out a specification to make users more clear 
about the principles of DistSQL syntax.
   
   For reference, MySQL provides some [Literal 
Values](https://dev.mysql.com/doc/refman/8.0/en/literals.html), and PostgreSQL 
also provides a description of the [Parameter Names and 
Values](https://www.postgresql.org/docs/14/config-setting.html) ​​​.
   
   I'll sort through this part and add more information.


-- 
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