Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3999#discussion_r23278031
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala ---
    @@ -315,6 +315,26 @@ class TableScanSuite extends DataSourceTest {
           (1 to 10).map(Row(_)).toSeq)
       }
     
    +  test("SPARK-5196 schema field with comment") {
    +    sql(
    +      """
    +       |CREATE TEMPORARY TABLE student(name string comment "SN", age int 
comment "SA", grade int)
    +       |USING org.apache.spark.sql.sources.AllDataTypesScanSource
    +       |OPTIONS (
    +       |  from '1',
    +       |  to '10'
    +       |)
    +       """.stripMargin)
    +
    +       val comments = sql("SELECT * FROM 
student").queryExecution.sparkPlan.
    +         schema.fields.map { field =>
    --- End diff --
    
    I think it is better to use `queryExecution.executedPlan` since it is the 
final physical. Also, this line is kind of long. How about we break it as 
follows.
    ```
    val planned = sql("SELECT * FROM student").queryExecution.executedPlan
    val comments = planned.schema.fields.map { ...
    ```


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to