Skip to content

Conversation

@GuoPhilipse
Copy link
Member

@GuoPhilipse GuoPhilipse commented May 22, 2020

What changes were proposed in this pull request?

add docs for sql migration-guide

Why are the changes needed?

let user know more about the cast scenarios in which Hive and Spark generate different results

Does this PR introduce any user-facing change?

no

How was this patch tested?

no need to test

@HyukjinKwon
Copy link
Member

@GuoPhilipse, let's file a JIRA although it's doc only, it's user-facing.

@GuoPhilipse
Copy link
Member Author

fine, i will create a JIRA for it.

@GuoPhilipse GuoPhilipse changed the title add docs for sql migration-guide [SPARK-31790][Documentation] add docs for sql migration-guide May 22, 2020
@HyukjinKwon HyukjinKwon changed the title [SPARK-31790][Documentation] add docs for sql migration-guide [SPARK-31790][DOCS] add docs for sql migration-guide May 22, 2020
@HyukjinKwon HyukjinKwon changed the title [SPARK-31790][DOCS] add docs for sql migration-guide [SPARK-31790][Documentation] Document cast(ts as long) difference between Hive and Spark May 22, 2020
@HyukjinKwon HyukjinKwon changed the title [SPARK-31790][Documentation] Document cast(ts as long) difference between Hive and Spark [SPARK-31790][DOCS] Document cast(ts as long) difference between Hive and Spark May 22, 2020
@GuoPhilipse
Copy link
Member Author

@HyukjinKwon cast(ts as long) may change to cast(long as timestamp) ?

@HyukjinKwon
Copy link
Member

@GuoPhilipse, feel free to fix the PR title and PR description with examples. It's your PR :-)

@GuoPhilipse GuoPhilipse changed the title [SPARK-31790][DOCS] Document cast(ts as long) difference between Hive and Spark [SPARK-31790][DOCS] cast(long as timestamp) show different result between Hive and Spark May 22, 2020
@GuoPhilipse
Copy link
Member Author

:) have corrected and added examples in JIRA

@GuoPhilipse
Copy link
Member Author

@HyukjinKwon what else did i need to do to close the jira and merge the patch ?

* `SQRT(n)` If n < 0, Hive returns null, Spark SQL returns NaN.
* `ACOS(n)` If n < -1 or n > 1, Hive returns null, Spark SQL returns NaN.
* `ASIN(n)` If n < -1 or n > 1, Hive returns null, Spark SQL returns NaN.
* `CAST(n as timestamp)` If n is Byte/Short/Int/Long data type, Hive treat n as milliseconds unit , while Spark SQL as seconds unit.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rephrase a bit more:

CAST(n AS TIMESTAMP) If n is integral numbers, Hive treats n as milliseconds, Spark SQL treats n as seconds .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool , have improved it.

@HyukjinKwon
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented May 22, 2020

Test build #122995 has finished for PR 28605 at commit 2f5b388.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 22, 2020

Test build #122998 has finished for PR 28605 at commit 5333afd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

HyukjinKwon commented May 22, 2020

Merged to master and branch-3.0.

HyukjinKwon pushed a commit that referenced this pull request May 22, 2020
…ween Hive and Spark

### What changes were proposed in this pull request?
add docs for sql migration-guide

### Why are the changes needed?
let user know more about the cast scenarios in which Hive and Spark generate different results

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
no need to test

Closes #28605 from GuoPhilipse/spark-docs.

Lead-authored-by: GuoPhilipse <[email protected]>
Co-authored-by: GuoPhilipse <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
(cherry picked from commit 892b600)
Signed-off-by: HyukjinKwon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants