fix
This commit is contained in:
parent
8a898192a9
commit
373522a976
@ -101,7 +101,7 @@ simple_mapper() ->
|
|||||||
Fields1 = lists:map(fun(#{<<\"key\">> := Key, <<\"value\">> := Val}) -> {Key, Val} end, Fields),
|
Fields1 = lists:map(fun(#{<<\"key\">> := Key, <<\"value\">> := Val}) -> {Key, Val} end, Fields),
|
||||||
Fields2 = maps:from_list(Fields1),
|
Fields2 = maps:from_list(Fields1),
|
||||||
Bin = jiffy:encode(Fields2#{<<\"location_code\">> => LocationCode}, [force_utf8]),
|
Bin = jiffy:encode(Fields2#{<<\"location_code\">> => LocationCode}, [force_utf8]),
|
||||||
iolist_to_binary(Bin)
|
{ok, iolist_to_binary(Bin)}
|
||||||
end.",
|
end.",
|
||||||
|
|
||||||
Mapper = list_to_binary(Mapper0),
|
Mapper = list_to_binary(Mapper0),
|
||||||
@ -113,7 +113,7 @@ mysql_mapper() ->
|
|||||||
Mapper0 = "fun(LocationCode, Fields, Timestamp) ->
|
Mapper0 = "fun(LocationCode, Fields, Timestamp) ->
|
||||||
Fields1 = lists:map(fun(#{<<\"key\">> := Key, <<\"value\">> := Val}) -> {Key, Val} end, Fields),
|
Fields1 = lists:map(fun(#{<<\"key\">> := Key, <<\"value\">> := Val}) -> {Key, Val} end, Fields),
|
||||||
Content = jiffy:encode(maps:from_list(Fields1), [force_utf8]),
|
Content = jiffy:encode(maps:from_list(Fields1), [force_utf8]),
|
||||||
[{<<\"location_code\">>, LocationCode}, {<<\"content\">>, Content}, {<<\"created_ts\">>, Timestamp}]
|
{ok, [{<<\"location_code\">>, LocationCode}, {<<\"content\">>, Content}, {<<\"created_ts\">>, Timestamp}]}
|
||||||
end.",
|
end.",
|
||||||
|
|
||||||
Mapper = list_to_binary(Mapper0),
|
Mapper = list_to_binary(Mapper0),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user