Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2543#discussion_r18564336
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -118,6 +120,19 @@ class Analyzer(catalog: Catalog, registry: 
FunctionRegistry, caseSensitive: Bool
       }
     
       /**
    +   * Make [[GetField]] case insensitive by passing a findField function
    +   */
    +  object ResolveGetField extends Rule[LogicalPlan] {
    +    def apply(plan: LogicalPlan): LogicalPlan = plan transform {
    +      case q: LogicalPlan =>
    +        q transformExpressions {
    +          case GetField(child, fieldName, null) =>
    +            GetField(child, fieldName, f => resolver(f.name, fieldName))
    +        }
    --- End diff --
    
    I was trying to follow this, but found it's hard to define the `resolved` 
in `GetField`. We have on idea whether a instance of `GetField` have been 
processed by the rule.
    Another question, Does the logic related to resolution include looking for 
corrected `StructField` according to the `fieldName`? If so, I think we should 
use `UnresolvedGetField` and resolve it in a rule and the `GetField` should 
only contains the corrected `StructFiled` and its `ordinal`.
    I'm not sure how much does looking for the corrected `StructField` cost, 
but if we do it here and get the corrected `StructField`, we still can't pass 
the `StructField` to `GetField` as `GetField` only accept `fieldName`, and 
`GetField` will do the searching again.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to