You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (JIRA)" <ji...@apache.org> on 2016/06/26 08:11:33 UTC

[jira] [Commented] (SPARK-16210) DataFrame.drop(colName) fails if another column has a period in its name

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

Dongjoon Hyun commented on SPARK-16210:
---------------------------------------

I also tested this.

Unfortunately Spark 1.6.2 (RC) still has this problem.
{code}
scala> sc.version
res0: String = 1.6.2

scala> val rdd = sc.makeRDD("""{"x.y": 5, "abc": 10}""" :: Nil)
rdd: org.apache.spark.rdd.RDD[String] = ParallelCollectionRDD[0] at makeRDD at <console>:27

scala> sqlContext.read.json(rdd).drop("abc")
org.apache.spark.sql.AnalysisException: cannot resolve 'x.y' given input columns: [abc, x.y];
{code}

Spark 2.0 (RC) can handle this.
{code}
scala> sc.version
res0: String = 2.0.0

scala> val rdd = sc.makeRDD("""{"x.y": 5, "abc": 10}""" :: Nil)
rdd: org.apache.spark.rdd.RDD[String] = ParallelCollectionRDD[0] at makeRDD at <console>:24

scala> spark.read.json(rdd).drop("abc")
res1: org.apache.spark.sql.DataFrame = [x.y: bigint]
{code}

> DataFrame.drop(colName) fails if another column has a period in its name
> ------------------------------------------------------------------------
>
>                 Key: SPARK-16210
>                 URL: https://issues.apache.org/jira/browse/SPARK-16210
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.6.1
>         Environment: Spark 1.6.1 on Databricks
>            Reporter: Simeon Simeonov
>              Labels: dataframe, sql
>
> The following code fails with {{org.apache.spark.sql.AnalysisException: cannot resolve 'x.y' given input columns: [abc, x.y]}} because of the way {{drop()}} uses {{select()}} under the covers.
> {code}
> val rdd = sc.makeRDD("""{"x.y": 5, "abc": 10}""" :: Nil)
> sqlContext.read.json(rdd).drop("abc")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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