Uploaded image for project: 'Apache MADlib'
  1. Apache MADlib
  2. MADLIB-1003

Partition expression in path function fails on multiple conditions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • v1.9.1
    • Module: Utilities
    • None

    Description

      The path function in utilities is supposed to accept expressions for the partition_expr parameter, but there are two aspects of the partition expression that are not handled currently:
      1) If there are more than one condition in the partition expression, path() fails to run successfully. For instance, consider the input table present in the install check file for path, the following function call results in an error:

      SELECT madlib.path('"Weblog"',
      '"Path_output"', 
      'user_id, age_group > 1, income_group > 1',
      'event_timestamp ASC',
      'I:="Click_event"=0 AND purchase_event=0, Click:="Click_event"=1 AND purchase_event=0, Conv:=purchase_event=1',
      'I(click){1}(CONV){1}',
      'COUNT(*)',
      TRUE);
      
      ERROR:  spiexceptions.DuplicateColumn: column "?column?" specified more than once
      CONTEXT:  Traceback (most recent call last):
        PL/Python function "path", line 23, in <module>
          return path.path(**globals())
        PL/Python function "path", line 276, in path
      PL/Python function "path"
      

      2) We cannot rename a particular condition/column name in the partition expression using "AS". For example, we get the following error with the function call shown below:

      SELECT madlib.path('"Weblog"',
      '"Path_output"', 
      'user_id AS uid,
      'event_timestamp ASC',
      'I:="Click_event"=0 AND purchase_event=0, Click:="Click_event"=1 AND purchase_event=0, Conv:=purchase_event=1',
      'I(click){1}(CONV){1}',
      'COUNT(*)',
      TRUE);
      
      ERROR:  spiexceptions.SyntaxError: syntax error at or near "AS"
      QUERY:  �
      CONTEXT:  Traceback (most recent call last):
        PL/Python function "path", line 23, in <module>
          return path.path(**globals())
        PL/Python function "path", line 114, in path
      PL/Python function "path"
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            njayaram Nandish Jayaram
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: