[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-02-01 Thread marmbrus
Github user marmbrus commented on a diff in the pull request:

https://github.com/apache/spark/pull/3999#discussion_r23904649
  
--- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala ---
@@ -344,4 +344,24 @@ class TableScanSuite extends DataSourceTest {
 }
 assert(schemaNeeded.getMessage.contains(A schema needs to be 
specified when using))
   }
+
+  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 planned = sql(SELECT * FROM 
student).queryExecution.executedPlan
+   val comments = planned.schema.fields.map { field =
+ if (field.metadata.contains(comment)) 
field.metadata.getString(comment)
+ else NO_COMMENT
+   }.mkString(,)
+
+assert(comments === SN,SA,NO_COMMENT, assert equals, display all 
comments of fields)
--- End diff --

I will fix this up while merging, but I don't think it is useful to both 
use `===` and give a comment that doesn't include the actual answer.  Ideally, 
when the test fails you want to see the answer that does not match the expected 
answer so you can figure out what went wrong without having to go and add 
`println` manually.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-02-01 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/3999


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-30 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-72303112
  
@marmbrus @rxin
Is this ready to merge?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-29 Thread marmbrus
Github user marmbrus commented on a diff in the pull request:

https://github.com/apache/spark/pull/3999#discussion_r23813157
  
--- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala ---
@@ -344,4 +344,24 @@ class TableScanSuite extends DataSourceTest {
 }
 assert(schemaNeeded.getMessage.contains(A schema needs to be 
specified when using))
   }
+
+  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 planned = sql(SELECT * FROM 
student).queryExecution.executedPlan
+   val comments = planned.schema.fields.map { field =
+ if (field.metadata.contains(comment)) 
field.metadata.getString(comment)
+ else NO_COMMENT
+   }.mkString(,)
+
+assert(comments == SN,SA,NO_COMMENT)
--- End diff --

Plain asserts should be avoided in tests as they give very little 
information when there is a failure.  Instead use `===` or add a custom string 
that describes what went wrong as the second argument.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-29 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-72150879
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26369/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-29 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-72150875
  
  [Test build #26369 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26369/consoleFull)
 for   PR 3999 at commit 
[`77bf089`](https://github.com/apache/spark/commit/77bf0897cec08b8ab7d205fa12fd79aefa571fe3).
 * This patch **passes all tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-29 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-72145922
  
  [Test build #26369 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26369/consoleFull)
 for   PR 3999 at commit 
[`77bf089`](https://github.com/apache/spark/commit/77bf0897cec08b8ab7d205fa12fd79aefa571fe3).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-29 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-72146682
  
  [Test build #26371 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26371/consoleFull)
 for   PR 3999 at commit 
[`39150d4`](https://github.com/apache/spark/commit/39150d433a9cdf6b65ea9fffb49aaed218190928).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-29 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-72151820
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26371/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-29 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-72151814
  
  [Test build #26371 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26371/consoleFull)
 for   PR 3999 at commit 
[`39150d4`](https://github.com/apache/spark/commit/39150d433a9cdf6b65ea9fffb49aaed218190928).
 * This patch **passes all tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-22 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70983891
  
  [Test build #25950 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25950/consoleFull)
 for   PR 3999 at commit 
[`d1cfb0f`](https://github.com/apache/spark/commit/d1cfb0fa7620c3cc6800087f32a2e4542884823f).
 * This patch **passes all tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-22 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70983903
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25950/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-21 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70978608
  
  [Test build #25949 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25949/consoleFull)
 for   PR 3999 at commit 
[`1c71505`](https://github.com/apache/spark/commit/1c71505c5b44cf4fd75fb7e18ec8e43987d11f32).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-21 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70983364
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25949/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-21 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70979284
  
  [Test build #25950 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25950/consoleFull)
 for   PR 3999 at commit 
[`d1cfb0f`](https://github.com/apache/spark/commit/d1cfb0fa7620c3cc6800087f32a2e4542884823f).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-21 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70983356
  
  [Test build #25949 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25949/consoleFull)
 for   PR 3999 at commit 
[`1c71505`](https://github.com/apache/spark/commit/1c71505c5b44cf4fd75fb7e18ec8e43987d11f32).
 * This patch **passes all tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-21 Thread yhuai
Github user yhuai commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70850713
  
LGTM


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-20 Thread yhuai
Github user yhuai commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70784321
  
Just one minor comment. Other than that, LGTM.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-20 Thread yhuai
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-20 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70790966
  
  [Test build #25876 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25876/consoleFull)
 for   PR 3999 at commit 
[`de6daa7`](https://github.com/apache/spark/commit/de6daa747a30c36464b0750186311b2ac82c97d2).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-20 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70797638
  
/cc @yhuai @marmbrus  
Test Passed.
Is that OK with you?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-20 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70796574
  
  [Test build #25876 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25876/consoleFull)
 for   PR 3999 at commit 
[`de6daa7`](https://github.com/apache/spark/commit/de6daa747a30c36464b0750186311b2ac82c97d2).
 * This patch **passes all tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-20 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70796578
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25876/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-16 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-70276610
  
ping @yhuai @marmbrus


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-14 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69892011
  
  [Test build #25538 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25538/consoleFull)
 for   PR 3999 at commit 
[`d5cba72`](https://github.com/apache/spark/commit/d5cba7253661c88b0954ff8a85702d477bbd3d85).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-14 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69904005
  
  [Test build #25541 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25541/consoleFull)
 for   PR 3999 at commit 
[`353bc4b`](https://github.com/apache/spark/commit/353bc4bf39673bfb4c8141cd8cb3efa54859ce12).
 * This patch **passes all tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-14 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69904014
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25541/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-14 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69892411
  
Test FAILed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25538/
Test FAILed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-14 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69896069
  
  [Test build #25541 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25541/consoleFull)
 for   PR 3999 at commit 
[`353bc4b`](https://github.com/apache/spark/commit/353bc4bf39673bfb4c8141cd8cb3efa54859ce12).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-14 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69892406
  
  [Test build #25538 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25538/consoleFull)
 for   PR 3999 at commit 
[`d5cba72`](https://github.com/apache/spark/commit/d5cba7253661c88b0954ff8a85702d477bbd3d85).
 * This patch **fails to build**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69569261
  
ping.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread yhuai
Github user yhuai commented on a diff in the pull request:

https://github.com/apache/spark/pull/3999#discussion_r22802272
  
--- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala ---
@@ -314,4 +314,20 @@ class TableScanSuite extends DataSourceTest {
   sql(SELECT * FROM oneToTenDef),
   (1 to 10).map(Row(_)).toSeq)
   }
+
+  test(schema field with comment) {
+sql(
+  
+   |CREATE TEMPORARY TABLE student(name string comment the name of a 
student)
--- End diff --

Can we update the schema to have 2 or more columns (just want to make sure 
the comma separator works well) and to have columns with and without comments?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread yhuai
Github user yhuai commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69597975
  
ok to test


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69598398
  
  [Test build #25421 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25421/consoleFull)
 for   PR 3999 at commit 
[`81b8431`](https://github.com/apache/spark/commit/81b8431382be8106603bc6317c86f635e27eee96).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69600606
  
  [Test build #25421 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25421/consoleFull)
 for   PR 3999 at commit 
[`81b8431`](https://github.com/apache/spark/commit/81b8431382be8106603bc6317c86f635e27eee96).
 * This patch **fails Spark unit tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69600617
  
Test FAILed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25421/
Test FAILed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread yhuai
Github user yhuai commented on a diff in the pull request:

https://github.com/apache/spark/pull/3999#discussion_r22801866
  
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/sources/ddl.scala ---
@@ -120,8 +122,10 @@ private[sql] class DDLParser extends 
StandardTokenParsers with PackratParsers wi
   protected lazy val pair: Parser[(String, String)] = ident ~ stringLit ^^ 
{ case k ~ v = (k,v) }
 
   protected lazy val column: Parser[StructField] =
-ident ~ dataType ^^ { case columnName ~ typ =
-  StructField(columnName, typ)
+ident ~ dataType ~ (COMMENT ~ stringLit).?  ^^ { case columnName ~ 
typ ~ cm =
+  val metadata = new MetadataBuilder()
+  .putString(COMMENT.str.toLowerCase(), cm.getOrElse()).build()
+  StructField(columnName, typ, true, metadata)
--- End diff --

How about we do not define the metadata if a comment is not provided? I 
feel we are losing information if we use an empty string when a comment is not 
provided.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69687629
  
Test FAILed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25449/
Test FAILed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69687626
  
  [Test build #25449 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25449/consoleFull)
 for   PR 3999 at commit 
[`1d0fbac`](https://github.com/apache/spark/commit/1d0fbace278142fda560b9b5b2354ca771f9cf97).
 * This patch **fails to build**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69686299
  
  [Test build #25445 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25445/consoleFull)
 for   PR 3999 at commit 
[`92fa3eb`](https://github.com/apache/spark/commit/92fa3eb816d8fde316aed8a6eedf8ba1ae00cc29).
 * This patch **fails Scala style tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69686220
  
  [Test build #25445 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25445/consoleFull)
 for   PR 3999 at commit 
[`92fa3eb`](https://github.com/apache/spark/commit/92fa3eb816d8fde316aed8a6eedf8ba1ae00cc29).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69687388
  
  [Test build #25449 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25449/consoleFull)
 for   PR 3999 at commit 
[`1d0fbac`](https://github.com/apache/spark/commit/1d0fbace278142fda560b9b5b2354ca771f9cf97).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69686301
  
Test FAILed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25445/
Test FAILed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69688135
  
  [Test build #25450 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25450/consoleFull)
 for   PR 3999 at commit 
[`d2c4caf`](https://github.com/apache/spark/commit/d2c4caf3f1b30ea4e3659aa1594387ef93e26bb8).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69692691
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25450/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69692687
  
  [Test build #25450 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25450/consoleFull)
 for   PR 3999 at commit 
[`d2c4caf`](https://github.com/apache/spark/commit/d2c4caf3f1b30ea4e3659aa1594387ef93e26bb8).
 * This patch **passes all tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69693709
  
@yhuai /cc @marmbrus
Does this look OK to you?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread yhuai
Github user yhuai commented on a diff in the pull request:

https://github.com/apache/spark/pull/3999#discussion_r22803087
  
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/sources/ddl.scala ---
@@ -120,8 +122,10 @@ private[sql] class DDLParser extends 
StandardTokenParsers with PackratParsers wi
   protected lazy val pair: Parser[(String, String)] = ident ~ stringLit ^^ 
{ case k ~ v = (k,v) }
 
   protected lazy val column: Parser[StructField] =
-ident ~ dataType ^^ { case columnName ~ typ =
-  StructField(columnName, typ)
+ident ~ dataType ~ (COMMENT ~ stringLit).?  ^^ { case columnName ~ 
typ ~ cm =
+  val metadata = new MetadataBuilder()
+  .putString(COMMENT.str.toLowerCase(), cm.getOrElse()).build()
+  StructField(columnName, typ, true, metadata)
--- End diff --

I think the test failure will be resolved once we do not create a 
`metadata` if there is no comment.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on a diff in the pull request:

https://github.com/apache/spark/pull/3999#discussion_r22805693
  
--- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala ---
@@ -314,4 +314,20 @@ class TableScanSuite extends DataSourceTest {
   sql(SELECT * FROM oneToTenDef),
   (1 to 10).map(Row(_)).toSeq)
   }
+
+  test(schema field with comment) {
+sql(
+  
+   |CREATE TEMPORARY TABLE student(name string comment the name of a 
student)
--- End diff --

sure, I'll add one


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on a diff in the pull request:

https://github.com/apache/spark/pull/3999#discussion_r22805706
  
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/sources/ddl.scala ---
@@ -120,8 +122,10 @@ private[sql] class DDLParser extends 
StandardTokenParsers with PackratParsers wi
   protected lazy val pair: Parser[(String, String)] = ident ~ stringLit ^^ 
{ case k ~ v = (k,v) }
 
   protected lazy val column: Parser[StructField] =
-ident ~ dataType ^^ { case columnName ~ typ =
-  StructField(columnName, typ)
+ident ~ dataType ~ (COMMENT ~ stringLit).?  ^^ { case columnName ~ 
typ ~ cm =
+  val metadata = new MetadataBuilder()
+  .putString(COMMENT.str.toLowerCase(), cm.getOrElse()).build()
+  StructField(columnName, typ, true, metadata)
--- End diff --

that's fine.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69609027
  
test this please


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69609091
  
@yhuai /cc @marmbrus
Updated code.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69609435
  
  [Test build #25424 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25424/consoleFull)
 for   PR 3999 at commit 
[`c2b6f3f`](https://github.com/apache/spark/commit/c2b6f3f9610ce35e0880f64f6360ed21bfc75762).
 * This patch merges cleanly.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread yhuai
Github user yhuai commented on a diff in the pull request:

https://github.com/apache/spark/pull/3999#discussion_r22803158
  
--- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala ---
@@ -314,4 +314,20 @@ class TableScanSuite extends DataSourceTest {
   sql(SELECT * FROM oneToTenDef),
   (1 to 10).map(Row(_)).toSeq)
   }
+
+  test(schema field with comment) {
+sql(
+  
+   |CREATE TEMPORARY TABLE student(name string comment the name of a 
student)
--- End diff --

It will be better to also compare the expected and actual schema.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69620736
  
  [Test build #25424 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25424/consoleFull)
 for   PR 3999 at commit 
[`c2b6f3f`](https://github.com/apache/spark/commit/c2b6f3f9610ce35e0880f64f6360ed21bfc75762).
 * This patch **passes all tests**.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-12 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69620751
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25424/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-11 Thread OopsOutOfMemory
GitHub user OopsOutOfMemory opened a pull request:

https://github.com/apache/spark/pull/3999

[SPARK-5196][SQL] Support `comment` in Create Table Field DDL

Support `comment` in create a table field.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/OopsOutOfMemory/spark meta_comment

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/3999.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #3999


commit 65c860ca1a7e7b37c63db3514b12740547c4aa3a
Author: OopsOutOfMemory victorshen...@126.com
Date:   2015-01-12T06:03:56Z

support comment in create table




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-11 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69533570
  
This is the better way to implement the `comment` syntax.
`Original implementation` #3991 is to add a field `comment` to `Expression, 
Atrribute, AtrributeReference` which involve modify too much files.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-11 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69533770
  
Jenkins, test this please


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-11 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69533694
  
Can one of the admins verify this patch?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request: [SPARK-5196][SQL] Support `comment` in Create ...

2015-01-11 Thread OopsOutOfMemory
Github user OopsOutOfMemory commented on the pull request:

https://github.com/apache/spark/pull/3999#issuecomment-69533944
  
@yhuai /cc @marmbrus
Could you review it ? After this, I'd like `describe table` command #3935 
to support display the comment field of each column.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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