FrankChen021 commented on issue #10619:
URL: https://github.com/apache/druid/issues/10619#issuecomment-737025869


   This issue is more relevant to SQL standard.
   
   According to SQL standard, double quoted strings refer to object names, 
which are usually name of tables or columns while single quoted strings refer 
to string value which are usually used in an expression or as an input argument 
of a function.
   
   In your first SQL, "AHH" is double quoted, Calcite(the SQL parser) treats it 
as a column name which obviously does not exist in table `stocks-5k` and throws 
the exception that you see.
   
   Table names or column names are not necessarily double quoted if they only 
contains letters and underscores.
   
   ```
   SELECT count(*) FROM "stocks" WHERE ticker = 'AHH' 
   ```
   
   is equivalent to 
   
   ```
   SELECT count(*) FROM stocks WHERE ticker = 'AHH' 
   ```
   
   But if there're spaces or other special characters like hyphen('-') in the 
names(`stocks-5k` in your example), the name must be double quoted or the SQL 
can't be parsed correctly.


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to