-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-18936][SQL] Infrastructure for session local timezone support. #16308
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 47 commits
c48a70d
1d21fec
0763c8f
449d93d
b59d902
3ddfae4
f58f00d
8f2040b
63c103c
7066850
1aaca29
e5bb246
32cc391
f434378
16fd1e4
009c17b
a2936ed
c5ca73e
b860379
6746265
4b6900c
4f9cc40
2ca2413
c232854
5b6dd4f
1ca5808
702dd81
33a3425
5cc93e3
5521165
bd8275e
183945c
22a3b6e
30d51fa
043ab52
3ba5830
9ab31f0
b954947
dbb2604
186cd3e
6631a69
3610465
c12e596
8a04e80
efe3aff
cdbb266
328399a
7352612
b99cf79
a85377f
f0c911b
6fa1d6a
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 |
|---|---|---|
|
|
@@ -26,10 +26,10 @@ import org.apache.spark.sql.catalyst.{FunctionIdentifier, InternalRow, TableIden | |
| import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeMap, Cast, Literal} | ||
| import org.apache.spark.sql.catalyst.plans.logical._ | ||
| import org.apache.spark.sql.catalyst.util.quoteIdentifier | ||
| import org.apache.spark.sql.catalyst.util.DateTimeUtils | ||
| import org.apache.spark.sql.types.StructType | ||
|
|
||
|
|
||
|
|
||
| /** | ||
| * A function defined in the catalog. | ||
| * | ||
|
|
@@ -114,7 +114,9 @@ case class CatalogTablePartition( | |
| */ | ||
| def toRow(partitionSchema: StructType): InternalRow = { | ||
| InternalRow.fromSeq(partitionSchema.map { field => | ||
| Cast(Literal(spec(field.name)), field.dataType).eval() | ||
| // TODO: use correct timezone for partition values. | ||
| Cast(Literal(spec(field.name)), field.dataType, | ||
| Option(DateTimeUtils.defaultTimeZone().getID)).eval() | ||
|
Contributor
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. can we make this a default value? e.g.
Contributor
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. by doing this, we can reduce code changes to the tests.
Contributor
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. but we don't want to have callers forgetting to specify
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. I agree with @rxin. |
||
| }) | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we add a Cast.unapply that returns only the first two arguments, we can reduce a lot of the cast match changes. Not sure if it is worth it though.