spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sanjay Dasgupta (JIRA)" <>
Subject [jira] [Created] (SPARK-16347) DataFrame allows duplicate column-names
Date Fri, 01 Jul 2016 17:21:11 GMT
Sanjay Dasgupta created SPARK-16347:

             Summary: DataFrame allows duplicate column-names
                 Key: SPARK-16347
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.0.0
         Environment: Databricks community edition
Scala notebook in Google-Chrome
Linux (Ubuntu 14.04LTS)
            Reporter: Sanjay Dasgupta

Certain DataFrame APIs allow duplicate column-names. The following code illustrates the problem:

case class Row(integer: Int, string1: String, string2: String)
val rows = spark.sparkContext.parallelize(Seq(Row(1, "one", "one"), Row(2, "two", "two"),
Row(3, "three", "three")))
val df = rows.toDF("integer", "string", "string")

Here is the output:

 |-- integer: integer (nullable = false)
 |-- string: string (nullable = true)
 |-- string: string (nullable = true)

defined class Row
rows: org.apache.spark.rdd.RDD[Row] = ParallelCollectionRDD[168] at parallelize at <console>:39
df: org.apache.spark.sql.DataFrame = [integer: int, string: string ... 1 more field]

This message was sent by Atlassian JIRA

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

View raw message