aboutsummaryrefslogtreecommitdiff
path: root/repl
diff options
context:
space:
mode:
authorWenchen Fan <cloud0fan@outlook.com>2015-02-06 13:08:09 -0800
committerMichael Armbrust <michael@databricks.com>2015-02-06 13:08:09 -0800
commit4793c8402a19afe4df51129a7f99e07494a76af2 (patch)
treea24381d399893601e2ab1647f34fd85d90d796ca /repl
parentbc36356080e3b52aaf61fc1e6b204146ab96d29f (diff)
downloadspark-4793c8402a19afe4df51129a7f99e07494a76af2.tar.gz
spark-4793c8402a19afe4df51129a7f99e07494a76af2.tar.bz2
spark-4793c8402a19afe4df51129a7f99e07494a76af2.zip
[SPARK-5278][SQL] Introduce UnresolvedGetField and complete the check of ambiguous reference to fields
When the `GetField` chain(`a.b.c.d.....`) is interrupted by `GetItem` like `a.b[0].c.d....`, then the check of ambiguous reference to fields is broken. The reason is that: for something like `a.b[0].c.d`, we first parse it to `GetField(GetField(GetItem(Unresolved("a.b"), 0), "c"), "d")`. Then in `LogicalPlan#resolve`, we resolve `"a.b"` and build a `GetField` chain from bottom(the relation). But for the 2 outer `GetFiled`, we have to resolve them in `Analyzer` or do it in `GetField` lazily, check data type of child, search needed field, etc. which is similar to what we have done in `LogicalPlan#resolve`. So in this PR, the fix is just copy the same logic in `LogicalPlan#resolve` to `Analyzer`, which is simple and quick, but I do suggest introduce `UnresolvedGetFiled` like I explained in https://github.com/apache/spark/pull/2405. Author: Wenchen Fan <cloud0fan@outlook.com> Closes #4068 from cloud-fan/simple and squashes the following commits: a6857b5 [Wenchen Fan] fix import order 8411c40 [Wenchen Fan] use UnresolvedGetField
Diffstat (limited to 'repl')
0 files changed, 0 insertions, 0 deletions