Github user shivzone commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/913#discussion_r82915549
  
    --- Diff: src/backend/access/external/pxffilters.c ---
    @@ -153,72 +186,102 @@ Oid pxf_supported_types[] =
        CHAROID,
        BYTEAOID,
        BOOLOID,
    -   DATEOID
    +   DATEOID,
    +   TIMESTAMPOID
     };
     
    +static void
    +pxf_free_expression_items_list(List *expressionItems, bool 
freeBoolExprNodes)
    +{
    +   ListCell                *lc     = NULL;
    +   ExpressionItem  *expressionItem = NULL;
    +   int previousLength;
    +
    +   while (list_length(expressionItems) > 0)
    +   {
    +           expressionItem = (ExpressionItem *) 
lfirst(list_head(expressionItems));
    +           if (freeBoolExprNodes && nodeTag(expressionItem->node) == 
T_BoolExpr)
    +           {
    +                   pfree((BoolExpr *)expressionItem->node);
    +           }
    +           pfree(expressionItem);
    +
    +           /* to avoid freeing already freed items - delete all 
occurrences of current expression*/
    +           previousLength = expressionItems->length + 1;
    +           while (expressionItems != NULL && previousLength > 
expressionItems->length)
    +           {
    +                   previousLength = expressionItems->length;
    +                   expressionItems = list_delete_ptr(expressionItems, 
expressionItem);
    +           }
    +   }
    +}
    +
     /*
    - * pxf_make_filter_list
    + * pxf_make_expression_items_list
      *
      * Given a scan node qual list, find the filters that are eligible to be 
used
    - * by PXF, construct a PxfFilterDesc list that describes the filter 
information,
    + * by PXF, construct an expressions list, which consists of OpExpr or 
BoolExpr nodes
    --- End diff --
    
    We are no longer checking for the validity of the filter in this function 
right. It is now checked in pxf_serialize_filter_list. So remove this comment.
    You don't have to mention in comment the types of expr supported as this 
list will be growing with time



---
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.
---

Reply via email to