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

    https://github.com/apache/incubator-madlib/pull/49#discussion_r67939838
  
    --- Diff: src/ports/postgres/modules/utilities/test/sessionize.sql_in ---
    @@ -87,6 +89,23 @@ SELECT
         assert(
             relative_error(array_agg(CASE WHEN original_session_id NOTNULL 
THEN original_session_id ELSE 0 END), array_agg(CASE WHEN session_id NOTNULL 
THEN session_id ELSE 0 END)) < 1e-6,
             'wrong output in sessionization')
    -FROM sessionize_output;
    +FROM sessionize_output_v;
    +SELECT * FROM sessionize_output_v;
    +
    +SELECT sessionize(
    +        'eventlog_installchk', -- Name of the input table
    +        'sessionize_output_t', -- Name of the output table
    +        'user_id<102000', -- Partition expression to group the data
    +        'event_timestamp', -- Order expression to sort the tuples of the 
data table
    +        '180', -- Max time that can elapse between consecutive rows to be 
considered part of the same session
    +        '*,user_id<102000',  -- Select all columns in the input table, 
along with the partition expression and session id columns
    --- End diff --
    
    Supporting arbitrary expressions in the column list is going to lead to 
confusion (or worse), because Postgres will call that column something else. 
I'm pretty sure this will break if you tried to turn it into a table, and I 
know it'll break if you try adding 2 expressions.
    
    Instead of trying to treat this as a column list, maybe it would be better 
to simply treat it as a replacement for the auto-generated select clause and be 
done with it. Does anything in code actually depend on having the list of 
columns?
    
    Something to ponder... a way to "cheat" and turn an arbitrary select clause 
into the columns that it will actually result in is to create a temporary view 
and then inspect the catalog to see what columns you ended up with. You can 
then drop the temp view.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to