[
https://issues.apache.org/jira/browse/DRILL-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13755937#comment-13755937
]
Julian Hyde commented on DRILL-197:
-----------------------------------
What Jacques said.
Other ways of quoting identifiers are possible -- e.g. MySQL uses back-ticks,
MSSql uses brackets -- but double-quotes is the most common. It is used by
Oracle, Teradata, Postgres.
No SQL-compliant database allows double-quotes for character literals. (MySQL
and Hive, I'm looking at you.)
I agree that double-quoted identifiers are not intuitive when you first see
them. I'd entertain the idea of switching to brackets, e.g.
select * from [HR].[Employees] where [name] = 'Ted'
> Difference between single and double quotes not clear and error messages are
> opaque
> -----------------------------------------------------------------------------------
>
> Key: DRILL-197
> URL: https://issues.apache.org/jira/browse/DRILL-197
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Ted Dunning
>
> The following query fails:
> {code}
> select _MAP["N_REGIONKEY"]
> from "nation.parquet"
> {code}
> but the following very similar query succeeds:
> {code}
> select _MAP['N_REGIONKEY']
> from "nation.parquet"
> {code}
> The difference is in the use of single or double quotes for the index of
> {{_MAP}}
> I certainly don't know what the difference is here, but it seems important to
> either resolve or document.
> Conversely, this query also fails, but this time because double quotes *have*
> to be used.
> {code}
> select _MAP['N_REGIONKEY']
> from 'nation.parquet';
> {code}
> This is pretty perverse.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira