You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by clockfly <gi...@git.apache.org> on 2016/06/13 23:34:56 UTC

[GitHub] spark issue #11079: [SPARK-13197][SQL] When trying to select from the data f...

Github user clockfly commented on the issue:

    https://github.com/apache/spark/pull/11079
  
    @thomastechs 
    
    We should use `df.select("`a.c`")` to select a column with name "a.c".
    The reason is that we can df.select can be used 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")
    res10: org.apache.spark.sql.DataFrame = [inner: int]
    
    scala> df2.select("a.inner").show()
    +-----+
    |inner|
    +-----+
    |    1|
    +-----+
    ```
    
    So, I think this is NOT a bug, current behavior of select is expected.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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