Quanlong Huang created IMPALA-13360:
---------------------------------------

             Summary: Set type of assignedConjuncts should be consistent
                 Key: IMPALA-13360
                 URL: https://issues.apache.org/jira/browse/IMPALA-13360
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
            Reporter: Quanlong Huang


'assignedConjuncts' is a set in the GlobalState of an Analyzer. It tracks the 
ExprIds of the assigned conjuncts. At the begining, it's a set backed by 
IdentityHashMap:
{code:java}
    public Set<ExprId> assignedConjuncts =
        Collections.newSetFromMap(new IdentityHashMap<ExprId, Boolean>());{code}
[https://github.com/apache/impala/blob/77a87bb10/fe/src/main/java/org/apache/impala/analysis/Analyzer.java#L502-L503]

So even if two Exprs have the same int id values, they could be different in 
GlobalState.assignedConjuncts as long as they have different ExprId *objects*.

However, later in creating the single node plan, the type of 
'assignedConjuncts' could be changed to HashSet here:
{code:java}
  public void setAssignedConjuncts(Set<ExprId> assigned) {
    globalState_.assignedConjuncts = Sets.newHashSet(assigned);
  } {code}
E.g. the type changes in SingleNodePlanner#createJoinPlan() after this line:
[https://github.com/apache/impala/blob/77a87bb10/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java#L598]

Fixing this can fix issues like IMPALA-13302. We should revisit whether we want 
to keep using IdentityHashMap, also revisit some TODOs like:
[https://github.com/apache/impala/blob/5d1bd80623324f829aca604b25d97ace21f51417/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java#L485-L486]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to