spark-instrumented-optimizer/R/pkg
gatorsmile d6ee69e776 [SPARK-22488][SQL] Fix the view resolution issue in the SparkSession internal table() API
## What changes were proposed in this pull request?
The current internal `table()` API of `SparkSession` bypasses the Analyzer and directly calls `sessionState.catalog.lookupRelation` API. This skips the view resolution logics in our Analyzer rule `ResolveRelations`. This internal API is widely used by various DDL commands, public and internal APIs.

Users might get the strange error caused by view resolution when the default database is different.
```
Table or view not found: t1; line 1 pos 14
org.apache.spark.sql.AnalysisException: Table or view not found: t1; line 1 pos 14
	at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
```

This PR is to fix it by enforcing it to use `ResolveRelations` to resolve the table.

## How was this patch tested?
Added a test case and modified the existing test cases

Author: gatorsmile <gatorsmile@gmail.com>

Closes #19713 from gatorsmile/viewResolution.
2017-11-11 18:20:11 +01:00
..
inst [SPARK-22344][SPARKR] Set java.io.tmpdir for SparkR tests 2017-10-29 18:53:47 -07:00
R [SPARK-22476][R] Add dayofweek function to R 2017-11-11 19:16:31 +09:00
src-native [SPARK-6811] Copy SparkR lib in make-distribution.sh 2015-05-23 00:04:01 -07:00
tests [SPARK-22488][SQL] Fix the view resolution issue in the SparkSession internal table() API 2017-11-11 18:20:11 +01:00
vignettes [SPARK-22344][SPARKR] clean up install dir if running test as source package 2017-11-10 10:22:42 -08:00
.lintr [SPARK-22063][R] Fixes lint check failures in R by latest commit sha1 ID of lint-r 2017-10-01 18:42:45 +09:00
.Rbuildignore [SPARK-20877][SPARKR][FOLLOWUP] clean up after test move 2017-06-11 03:00:44 -07:00
DESCRIPTION [SPARK-21805][SPARKR] Disable R vignettes code on Windows 2017-08-23 21:35:17 -07:00
NAMESPACE [SPARK-22476][R] Add dayofweek function to R 2017-11-11 19:16:31 +09:00