• H
    Share external URL-mapping code between planner and ORCA. · cbb8ea18
    Heikki Linnakangas 提交于
    Planner and ORCA translator both implemented the same logic, to assign
    external table URIs to segments. But I spotted one case where the logic
    differed:
    
    CREATE EXTERNAL TABLE exttab_with_on_master( i int, j text )
    LOCATION ('file://@hostname@@abs_srcdir@/data/exttab_few_errors.data') ON MASTER FORMAT 'TEXT' (DELIMITER '|');
    
    SELECT * FROM exttab_with_on_master;
    ERROR:  'ON MASTER' is not supported by this protocol yet.
    
    With ORCA you got a less user-friendly error:
    
    set optimizer=on;
    set optimizer_enable_master_only_queries = on;
    postgres=# explain SELECT * FROM exttab_with_on_master;
    ERROR:  External scan error: Could not assign a segment database for external file (CTranslatorDXLToPlStmt.cpp:472)
    
    The immediate cause of that was that commit fcf82234 didn't remember to
    modify the ORCA translator's copy of the same logic. But really, it's silly
    and error-prone to duplicate the code, so modify ORCA to use the same code
    that the planner does.
    cbb8ea18
gpdbwrappers.h 20.9 KB