Uh oh!
There was an error while loading. Please reload this page.
[SPARK-15321] Fix bug where Array[Timestamp] cannot be encoded/decoded correctly - #13108
[SPARK-15321] Fix bug where Array[Timestamp] cannot be encoded/decoded correctly#13108smungee wants to merge 1 commit into
Conversation
HyukjinKwon
commented
May 14, 2016
(I think it might needs a JIRA because it seems changing existing behaviour) |
smungee
commented
May 14, 2016
@HyukjinKwon I think the original author might have just forgotten to add the TimestampType to the match.. |
smungee
commented
May 14, 2016
The bug is quite easy to reproduce. In
... you will see that (without this fix) it fails with the following output: |
techaddict
commented
May 14, 2016
@smungee Can you please add tests for this ? |
smungee
commented
May 14, 2016
@techaddict Added a test |
rxin
commented
May 20, 2016
@smungee sorry to have this gone stale. Do you mind bringing it up to date? This seems useful to fix. |
387e6c9 to
b2f2914Comparesmungee
commented
May 20, 2016
@rxin The code in question seems to have been removed in this commit by @cloud-fan With the latest SNAPSHOT version, I no longer see the bug. I've updated this PR to include just my additional test-case, just to make sure it doesn't happen again. I'd recommend adding this test-case in. |
SparkQA
commented
May 20, 2016
Test build #2999 has finished for PR 13108 at commit
|
cloud-fan
commented
May 20, 2016
LGTM, merging to master and 2.0, thanks! |
…d correctly
## What changes were proposed in this pull request?
Fix `MapObjects.itemAccessorMethod` to handle `TimestampType`. Without this fix, `Array[Timestamp]` cannot be properly encoded or decoded. To reproduce this, in `ExpressionEncoderSuite`, if you add the following test case:
`encodeDecodeTest(Array(Timestamp.valueOf("2016-01-29 10:00:00")), "array of timestamp")
`
... you will see that (without this fix) it fails with the following output:
```
- encode/decode for array of timestamp: [Ljava.sql.Timestamp;fd9ebde *** FAILED ***
Exception thrown while decoding
Converted: [0,1000000010,800000001,52a7ccdc36800]
Schema: value#61615
root
-- value: array (nullable = true)
|-- element: timestamp (containsNull = true)
Encoder:
class[value[0]: array<timestamp>] (ExpressionEncoderSuite.scala:312)
```
## How was this patch tested?
Existing tests
Author: Sumedh Mungee <smungee@gmail.com>
Closes#13108 from smungee/fix-itemAccessorMethod.
(cherry picked from commit d5c47f8)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
Fix
MapObjects.itemAccessorMethodto handleTimestampType. Without this fix,Array[Timestamp]cannot be properly encoded or decoded. To reproduce this, inExpressionEncoderSuite, if you add the following test case:encodeDecodeTest(Array(Timestamp.valueOf("2016-01-29 10:00:00")), "array of timestamp")... you will see that (without this fix) it fails with the following output:
How was this patch tested?
Existing tests