Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-2729] [SQL] Forgot to match Timestamp type in ColumnBuilder #1636

Closed
wants to merge 3 commits into from

Conversation

chutium
Copy link
Contributor

@chutium chutium commented Jul 29, 2014

just a match forgot, found after SPARK-2710 , TimestampType can be used by a SchemaRDD generated from JDBC ResultSet

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@marmbrus
Copy link
Contributor

Can you please add [SQL] to any PR title that touches Spark SQL?

test this please

@marmbrus
Copy link
Contributor

We should also add a test case for this.

@chutium
Copy link
Contributor Author

chutium commented Jul 29, 2014

jo, thanks, i will add [SQL] next time

@chutium chutium changed the title [SPARK-2729] Forgot to match Timestamp type in ColumnBuilder [SPARK-2729] [SQL] Forgot to match Timestamp type in ColumnBuilder Jul 29, 2014
@marmbrus
Copy link
Contributor

Will you have time to add a test case before Friday (the merge deadline for 1.1) or should I?

@chutium
Copy link
Contributor Author

chutium commented Jul 30, 2014

it seems should be this one?
NullableColumnBuilderSuite.scala

i can do it

@chutium
Copy link
Contributor Author

chutium commented Jul 30, 2014

NullableColumnBuilderSuite:
...
...
- TIMESTAMP column builder: empty column
- TIMESTAMP column builder: buffer size auto growth
- TIMESTAMP column builder: null values
All tests passed.

@chutium
Copy link
Contributor Author

chutium commented Jul 30, 2014

if you have time, maybe take a look at #1612 ? it is about this ticket, https://issues.apache.org/jira/browse/SPARK-2710 , test suite just added.

it will be a good feature for some use cases, such as we use RDBMS (OLTP) to store daily incremental data, and full data stored in Hadoop, we want to use Spark SQL to join or union the tables from these two data source. now we must hard code case class for each tables came from JDBC...

and i find this one for CSV #1351 , it seems it is a good sample for adding new SchemaRDD types, need also to add some interface in sql.py and JavaSQLContext right?

@marmbrus
Copy link
Contributor

Thanks for working on this. I think that that test actually passes even without your change, so I don't think its sufficient. Maybe @liancheng has an idea of how to test this better.

Regarding #1612, I'm very excited about this functionality as it is something we have been talking about for a while. I will look at it after we cut a release candidate for Spark 1.1 (this friday).

@liancheng
Copy link
Contributor

@chutium Michael is right, NullableColumnBuilderSuite doesn't call ColumnBuilder.apply, thus it always passes. But adding TIMESTAMP still makes sense. Actually, would you mind to add TIMESTAMP to NullableColumnAccessorSuite too? These two test suites are structurally similar. Thanks!

To add a valid test case for this PR, I'd recommend InMemoryColumnarQuerySuite. You may refer to my comment in SPARK-2729 to write this test.

@chutium
Copy link
Contributor Author

chutium commented Jul 31, 2014

thanks a lot to you both, cast string to timestamp is really clever :)

@marmbrus
Copy link
Contributor

marmbrus commented Aug 1, 2014

Friendly reminder, it would be great to have a the test cases suggested by @liancheng so we can merge this by the deadline (friday).

@liancheng
Copy link
Contributor

@marmbrus I've discussed with @chutium offline. Since 1.1 code freeze deadline is close, we can merge this first. I tested this PR locally and it looks good. Will submit another PR to add the test case.

@marmbrus
Copy link
Contributor

marmbrus commented Aug 1, 2014

Thanks! I've merged this into master.

@asfgit asfgit closed this in 580c701 Aug 1, 2014
asfgit pushed a commit that referenced this pull request Aug 3, 2014
This is a follow up of #1636.

Author: Cheng Lian <lian.cs.zju@gmail.com>

Closes #1738 from liancheng/test-for-spark-2729 and squashes the following commits:

b13692a [Cheng Lian] Added test case for SPARK-2729
asfgit pushed a commit that referenced this pull request Aug 3, 2014
This is a follow up of #1636.

Author: Cheng Lian <lian.cs.zju@gmail.com>

Closes #1738 from liancheng/test-for-spark-2729 and squashes the following commits:

b13692a [Cheng Lian] Added test case for SPARK-2729

(cherry picked from commit 866cf1f)
Signed-off-by: Michael Armbrust <michael@databricks.com>
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
just a match forgot, found after SPARK-2710 , TimestampType can be used by a SchemaRDD generated from JDBC ResultSet

Author: chutium <teng.qiu@gmail.com>

Closes apache#1636 from chutium/SPARK-2729 and squashes the following commits:

71af77a [chutium] [SPARK-2729] [SQL] added Timestamp in NullableColumnAccessorSuite
39cf9f8 [chutium] [SPARK-2729] add Timestamp Type into ColumnBuilder TestSuite, ref. apache#1636
ab6ff97 [chutium] [SPARK-2729] Forgot to match Timestamp type in ColumnBuilder
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
This is a follow up of apache#1636.

Author: Cheng Lian <lian.cs.zju@gmail.com>

Closes apache#1738 from liancheng/test-for-spark-2729 and squashes the following commits:

b13692a [Cheng Lian] Added test case for SPARK-2729
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants