[jira] [Commented] (SPARK-19473) Several DataFrame Methods still fail with dot in column names

2017-02-08 Thread Thomas Sebastian (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-19473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15859135#comment-15859135
 ] 

Thomas Sebastian commented on SPARK-19473:
--

As mentioned in the PR: https://github.com/apache/spark/pull/11079
This is an expected behaviour.
As updated from [~clockfly]
"
We should use df.select("a.c") to select a column with name "a.c".
The reason is that we can use df.select("path.to.column") to select a nested 
column, for example:

scala> case class A(inner: Int)
scala> val df = Seq((A(1), 2)).toDF("a", "b")
scala> df.select("a.inner").show()
+-+
|inner|
+-+
|1|
+-+

Thus, this would not be a bug as such.

> Several DataFrame Methods still fail with dot in column names 
> --
>
> Key: SPARK-19473
> URL: https://issues.apache.org/jira/browse/SPARK-19473
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.1.0
>Reporter: Wayne Zhang
>
> Here is an example:
> {code}
> val df = Seq((1.0, 2.0), (2.0, 3.0)).toDF("y.a", "x.b")
> df.select("y.a")
> org.apache.spark.sql.AnalysisException: cannot resolve '`y.a`' given input 
> columns: [y.a, x.b];;
> df.withColumn("d", col("y.a") + col("x.b"))
> org.apache.spark.sql.AnalysisException: cannot resolve '`y.a`' given input 
> columns: [y.a, x.b];;
> {code}
> We can use backquote to avoid the errors, but this behavior is affecting some 
> downstream work such as RFormula and SparkR. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-19473) Several DataFrame Methods still fail with dot in column names

2017-02-08 Thread Jayadevan M (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-19473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15858239#comment-15858239
 ] 

Jayadevan M commented on SPARK-19473:
-

I think this is a duplicate jira - 
https://issues.apache.org/jira/browse/SPARK-13197. This issue already discussed 
and closed.

> Several DataFrame Methods still fail with dot in column names 
> --
>
> Key: SPARK-19473
> URL: https://issues.apache.org/jira/browse/SPARK-19473
> Project: Spark
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 2.1.0
>Reporter: Wayne Zhang
>
> Here is an example:
> {code}
> val df = Seq((1.0, 2.0), (2.0, 3.0)).toDF("y.a", "x.b")
> df.select("y.a")
> org.apache.spark.sql.AnalysisException: cannot resolve '`y.a`' given input 
> columns: [y.a, x.b];;
> df.withColumn("d", col("y.a") + col("x.b"))
> org.apache.spark.sql.AnalysisException: cannot resolve '`y.a`' given input 
> columns: [y.a, x.b];;
> {code}
> We can use backquote to avoid the errors, but this behavior is affecting some 
> downstream work such as RFormula and SparkR. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org