Skip to content

Conversation

@seancxmao
Copy link
Contributor

What changes were proposed in this pull request?

Since Spark 2.2, view definitions are stored in a different way from prior versions. This may cause Spark unable to read views created by prior versions. See SPARK-25797 for more details.

Basically, we have 2 options.

  1. Make Spark 2.2+ able to get older view definitions back. Since the expanded text is buggy and unusable, we have to use original text (this is possible with SPARK-25459). However, because older Spark versions don't save the context for the database, we cannot always get correct view definitions without view default database.
  2. Recreate the views by ALTER VIEW AS or CREATE OR REPLACE VIEW AS.

This PR aims to add migration doc to help users troubleshoot this issue by above option 2.

How was this patch tested?

N/A.

Docs are generated and checked locally

cd docs
SKIP_API=1 jekyll serve --watch

@SparkQA
Copy link

SparkQA commented Oct 26, 2018

Test build #98077 has finished for PR 22846 at commit a6f4d54.

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

@seancxmao
Copy link
Contributor Author

@jiangxb1987 @cloud-fan @gatorsmile Could you please kindly review this when you have time?

asfgit pushed a commit that referenced this pull request Oct 26, 2018
…by view canonicalization approach change

## What changes were proposed in this pull request?
Since Spark 2.2, view definitions are stored in a different way from prior versions. This may cause Spark unable to read views created by prior versions. See [SPARK-25797](https://issues.apache.org/jira/browse/SPARK-25797) for more details.

Basically, we have 2 options.
1) Make Spark 2.2+ able to get older view definitions back. Since the expanded text is buggy and unusable, we have to use original text (this is possible with [SPARK-25459](https://issues.apache.org/jira/browse/SPARK-25459)). However, because older Spark versions don't save the context for the database, we cannot always get correct view definitions without view default database.
2) Recreate the views by `ALTER VIEW AS` or `CREATE OR REPLACE VIEW AS`.

This PR aims to add migration doc to help users troubleshoot this issue by above option 2.

## How was this patch tested?
N/A.

Docs are generated and checked locally

```
cd docs
SKIP_API=1 jekyll serve --watch
```

Closes #22846 from seancxmao/SPARK-25797.

Authored-by: seancxmao <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 6fd5ff3)
Signed-off-by: Wenchen Fan <[email protected]>
@cloud-fan
Copy link
Contributor

LGTM, merging to master/2.4!

it conflicts with 2.3, can you send a new PR? thanks!

@asfgit asfgit closed this in 6fd5ff3 Oct 26, 2018
@seancxmao
Copy link
Contributor Author

@cloud-fan Sure, I will send a new PR for 2.3. Thanks you for review this.

@seancxmao
Copy link
Contributor Author

@cloud-fan PR for 2.3 is submitted. Please see #22851.

jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
…by view canonicalization approach change

## What changes were proposed in this pull request?
Since Spark 2.2, view definitions are stored in a different way from prior versions. This may cause Spark unable to read views created by prior versions. See [SPARK-25797](https://issues.apache.org/jira/browse/SPARK-25797) for more details.

Basically, we have 2 options.
1) Make Spark 2.2+ able to get older view definitions back. Since the expanded text is buggy and unusable, we have to use original text (this is possible with [SPARK-25459](https://issues.apache.org/jira/browse/SPARK-25459)). However, because older Spark versions don't save the context for the database, we cannot always get correct view definitions without view default database.
2) Recreate the views by `ALTER VIEW AS` or `CREATE OR REPLACE VIEW AS`.

This PR aims to add migration doc to help users troubleshoot this issue by above option 2.

## How was this patch tested?
N/A.

Docs are generated and checked locally

```
cd docs
SKIP_API=1 jekyll serve --watch
```

Closes apache#22846 from seancxmao/SPARK-25797.

Authored-by: seancxmao <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants