presto-gateway icon indicating copy to clipboard operation
presto-gateway copied to clipboard

Why resource_group_id is varchar type in exact_match_source_selectors?

Open byungnam opened this issue 2 years ago • 1 comments

Hi. I have a question about a table named exact_match_source_selectors.

There is a column named resource_group_id, which has bigint type for every table but except from exact_match_source_selectors. It has varchar type on there.

Why is that? Even the committer wrote "WTF" from the comment.

https://github.com/lyft/presto-gateway/blob/3d3159e792714221ca2e4b5a72385e0da391dc56/gateway-ha/src/main/resources/gateway-ha-persistence.sql#L67-L68

Is it intended? If so, what was the reason to do that?

byungnam avatar Aug 26 '22 08:08 byungnam

Any update on this the script does not work in its current state. This is the update I had to make to the script to run.

CREATE TABLE IF NOT EXISTS exact_match_source_selectors (
    resource_group_id VARCHAR(128) NOT NULL,  -- WTF varchar?!
    update_time DATETIME NOT NULL,

    -- Selector fields which must exactly match a query
    source VARCHAR(256) NOT NULL, -- (reduced from 512)
    environment VARCHAR(128),
    query_type VARCHAR(128), -- (reduced from 512)

    PRIMARY KEY (environment, source, query_type),
    UNIQUE (source, environment, query_type, resource_group_id)
);

rwilliams-r7 avatar Mar 20 '23 22:03 rwilliams-r7