-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-32576][SQL][TEST][FOLLOWUP] Add tests for all the character array types in PostgresIntegrationSuite #29397
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,13 @@ class PostgresIntegrationSuite extends DockerJDBCIntegrationSuite { | |
| ).executeUpdate() | ||
| conn.prepareStatement("INSERT INTO char_types VALUES " + | ||
| "('abcd', 'efgh', 'ijkl', 'mnop', 'q')").executeUpdate() | ||
|
|
||
| conn.prepareStatement("CREATE TABLE char_array_types (" + | ||
| "c0 char(4)[], c1 character(4)[], c2 character varying(4)[], c3 varchar(4)[], c4 bpchar[])" | ||
| ).executeUpdate() | ||
| conn.prepareStatement("INSERT INTO char_array_types VALUES " + | ||
| """('{"a", "bcd"}', '{"ef", "gh"}', '{"i", "j", "kl"}', '{"mnop"}', '{"q", "r"}')""" | ||
| ).executeUpdate() | ||
| } | ||
|
|
||
| test("Type mapping for various types") { | ||
|
|
@@ -235,4 +242,16 @@ class PostgresIntegrationSuite extends DockerJDBCIntegrationSuite { | |
| assert(row(0).getString(3) === "mnop") | ||
| assert(row(0).getString(4) === "q") | ||
| } | ||
|
|
||
| test("character array type tests") { | ||
| val df = sqlContext.read.jdbc(jdbcUrl, "char_array_types", new Properties) | ||
| val row = df.collect() | ||
| assert(row.length == 1) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super nit:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, I missed that. But, its trivial, so I'll fix it next time I update this file. Anyway, thanks for the check, @yaooqinn
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's alright. We don't currently have a style rule for that. |
||
| assert(row(0).length === 5) | ||
| assert(row(0).getSeq[String](0) === Seq("a ", "bcd ")) | ||
| assert(row(0).getSeq[String](1) === Seq("ef ", "gh ")) | ||
| assert(row(0).getSeq[String](2) === Seq("i", "j", "kl")) | ||
| assert(row(0).getSeq[String](3) === Seq("mnop")) | ||
| assert(row(0).getSeq[String](4) === Seq("q", "r")) | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.