local function split(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; local i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end

local matchId       = ARGV[1]
local keys          = split(ARGV[2], ",")
local result        = {}

for i = 1, #keys, 1 do
    local data = redis.call("HGETALL", keys[i])
    table.insert(result, data)
end
return result