Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

This fixes a corner-case regression caused by #36625. Users may have existing views that have invalid locations due to historical reasons. The location is actually useless for a view, but after #36625 , they start to fail to read the view as qualifying the location fails. We should just skip qualifying view locations.

Why are the changes needed?

avoid regression

Does this PR introduce any user-facing change?

Spark can read view with invalid location again.

How was this patch tested?

manually test. View with an invalid location is kind of "broken" and can't be dropped (HMS fails to drop it), so we can't write a UT for it.

@github-actions github-actions bot added the SQL label Oct 20, 2022
@cloud-fan
Copy link
Contributor Author

cc @wangyum

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM.

@dongjoon-hyun
Copy link
Member

Merged to master. Thank you, @cloud-fan , @wangyum , @MaxGekk .

SandishKumarHN pushed a commit to SandishKumarHN/spark that referenced this pull request Dec 12, 2022
### What changes were proposed in this pull request?

This fixes a corner-case regression caused by apache#36625. Users may have existing views that have invalid locations due to historical reasons. The location is actually useless for a view, but after apache#36625 , they start to fail to read the view as qualifying the location fails. We should just skip qualifying view locations.

### Why are the changes needed?

avoid regression

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

Spark can read view with invalid location again.

### How was this patch tested?

manually test. View with an invalid location is kind of "broken" and can't be dropped (HMS fails to drop it), so we can't write a UT for it.

Closes apache#38321 from cloud-fan/follow.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
HyukjinKwon pushed a commit that referenced this pull request Apr 21, 2023
…d on database URI

### What changes were proposed in this pull request?

This reverts #36625 and its followup #38321 .

### Why are the changes needed?

External table location can be arbitrary and has no connection with the database location. It can be wrong to qualify the external table location based on the database location.

If a table written by old Spark versions does not have a qualified location, there is no way to restore it as the information is already lost. People can manually fix the table locations assuming they are under the same HDFS cluster with the database location, by themselves.

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

no

### How was this patch tested?

N/A

Closes #40871 from cloud-fan/minor.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
HyukjinKwon pushed a commit that referenced this pull request Apr 21, 2023
…d on database URI

### What changes were proposed in this pull request?

This reverts #36625 and its followup #38321 .

### Why are the changes needed?

External table location can be arbitrary and has no connection with the database location. It can be wrong to qualify the external table location based on the database location.

If a table written by old Spark versions does not have a qualified location, there is no way to restore it as the information is already lost. People can manually fix the table locations assuming they are under the same HDFS cluster with the database location, by themselves.

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

no

### How was this patch tested?

N/A

Closes #40871 from cloud-fan/minor.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit afd9e2c)
Signed-off-by: Hyukjin Kwon <[email protected]>
snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Jun 20, 2023
…d on database URI

### What changes were proposed in this pull request?

This reverts apache#36625 and its followup apache#38321 .

### Why are the changes needed?

External table location can be arbitrary and has no connection with the database location. It can be wrong to qualify the external table location based on the database location.

If a table written by old Spark versions does not have a qualified location, there is no way to restore it as the information is already lost. People can manually fix the table locations assuming they are under the same HDFS cluster with the database location, by themselves.

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

no

### How was this patch tested?

N/A

Closes apache#40871 from cloud-fan/minor.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit afd9e2c)
Signed-off-by: Hyukjin Kwon <[email protected]>
GladwinLee pushed a commit to lyft/spark that referenced this pull request Oct 10, 2023
…d on database URI

### What changes were proposed in this pull request?

This reverts apache#36625 and its followup apache#38321 .

### Why are the changes needed?

External table location can be arbitrary and has no connection with the database location. It can be wrong to qualify the external table location based on the database location.

If a table written by old Spark versions does not have a qualified location, there is no way to restore it as the information is already lost. People can manually fix the table locations assuming they are under the same HDFS cluster with the database location, by themselves.

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

no

### How was this patch tested?

N/A

Closes apache#40871 from cloud-fan/minor.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit afd9e2c)
Signed-off-by: Hyukjin Kwon <[email protected]>
catalinii pushed a commit to lyft/spark that referenced this pull request Oct 10, 2023
…d on database URI

### What changes were proposed in this pull request?

This reverts apache#36625 and its followup apache#38321 .

### Why are the changes needed?

External table location can be arbitrary and has no connection with the database location. It can be wrong to qualify the external table location based on the database location.

If a table written by old Spark versions does not have a qualified location, there is no way to restore it as the information is already lost. People can manually fix the table locations assuming they are under the same HDFS cluster with the database location, by themselves.

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

no

### How was this patch tested?

N/A

Closes apache#40871 from cloud-fan/minor.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit afd9e2c)
Signed-off-by: Hyukjin Kwon <[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.

4 participants