spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Takeshi Yamamuro (JIRA)" <>
Subject [jira] [Commented] (SPARK-18502) Spark does not handle columns that contain backquote (`)
Date Wed, 30 Nov 2016 01:40:58 GMT


Takeshi Yamamuro commented on SPARK-18502:

Currently, AFAIK no.
However, the SQL standard (
specifies a double quotation (") as an escape one and I feel we need a general approach to
escape these metacharacters in Spark.
Certainly, other databases can use back quotations in column names.
ex) PostgreSQL
postgres=# create table test_table("i`d" INT, "value" VARCHAR);
postgres=# \d test_table
       Table "public.test_table"
 Column |       Type        | Modifiers 
 i`d    | integer           | 
 value  | character varying | 

postgres=# insert into test_table values(1, 'aa');
postgres=# select "i`d" from test_table; 
(1 row)


> Spark does not handle columns that contain backquote (`)
> --------------------------------------------------------
>                 Key: SPARK-18502
>                 URL:
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Barry Becker
>            Priority: Minor
> I know that if a column contains dots or hyphens we can put backquotes/backticks around
it, but what if the column contains a backtick (`)? Can the back tick be escaped by some means?
> Here is an example of the sort of error I see
> {code}
> org.apache.spark.sql.AnalysisException: syntax error in attribute name: `Invoice`Date`;org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute$.e$1(unresolved.scala:99)
org.apache.spark.sql.Column.(Column.scala:113) org.apache.spark.sql.Column$.apply(Column.scala:36)
org.apache.spark.sql.functions$.min(functions.scala:407) com.mineset.spark.vizagg.vizbin.strategies.DateBinStrategy.getDateExtent(DateBinStrategy.scala:158)

> {code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message