Merge pull request #12772 from killme2008/feature/upgrade-greptimedb-ingester-ci

feat: update greptimedb client lib and ci version
This commit is contained in:
Zaiming (Stone) Shi 2024-04-08 09:02:03 +02:00 committed by GitHub
commit 3e87d4bf9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 8 deletions

View File

@ -4,7 +4,7 @@ services:
greptimedb: greptimedb:
container_name: greptimedb container_name: greptimedb
hostname: greptimedb hostname: greptimedb
image: greptime/greptimedb:v0.4.4 image: greptime/greptimedb:v0.7.1
expose: expose:
- "4000" - "4000"
- "4001" - "4001"

View File

@ -6,7 +6,7 @@
{emqx_connector, {path, "../../apps/emqx_connector"}}, {emqx_connector, {path, "../../apps/emqx_connector"}},
{emqx_resource, {path, "../../apps/emqx_resource"}}, {emqx_resource, {path, "../../apps/emqx_resource"}},
{emqx_bridge, {path, "../../apps/emqx_bridge"}}, {emqx_bridge, {path, "../../apps/emqx_bridge"}},
{greptimedb, {git, "https://github.com/GreptimeTeam/greptimedb-client-erl", {tag, "v0.1.7"}}} {greptimedb, {git, "https://github.com/GreptimeTeam/greptimedb-ingester-erl", {tag, "v0.1.8"}}}
]}. ]}.
{plugins, [rebar3_path_deps]}. {plugins, [rebar3_path_deps]}.
{project_plugins, [erlfmt]}. {project_plugins, [erlfmt]}.

View File

@ -324,7 +324,7 @@ query_by_clientid(Topic, ClientId, Config) ->
{"Content-Type", "application/x-www-form-urlencoded"} {"Content-Type", "application/x-www-form-urlencoded"}
], ],
Body = <<"sql=select * from \"", Topic/binary, "\" where clientid='", ClientId/binary, "'">>, Body = <<"sql=select * from \"", Topic/binary, "\" where clientid='", ClientId/binary, "'">>,
{ok, 200, _Headers, RawBody0} = {ok, StatusCode, _Headers, RawBody0} =
ehttpc:request( ehttpc:request(
EHttpcPoolName, EHttpcPoolName,
post, post,
@ -335,7 +335,6 @@ query_by_clientid(Topic, ClientId, Config) ->
case emqx_utils_json:decode(RawBody0, [return_maps]) of case emqx_utils_json:decode(RawBody0, [return_maps]) of
#{ #{
<<"code">> := 0,
<<"output">> := [ <<"output">> := [
#{ #{
<<"records">> := #{ <<"records">> := #{
@ -344,12 +343,12 @@ query_by_clientid(Topic, ClientId, Config) ->
} }
} }
] ]
} -> } when StatusCode >= 200 andalso StatusCode =< 300 ->
make_row(Schema, Rows); make_row(Schema, Rows);
#{ #{
<<"code">> := Code, <<"code">> := Code,
<<"error">> := Error <<"error">> := Error
} -> } when StatusCode > 300 ->
GreptimedbName = ?config(greptimedb_name, Config), GreptimedbName = ?config(greptimedb_name, Config),
Type = greptimedb_type_bin(?config(greptimedb_type, Config)), Type = greptimedb_type_bin(?config(greptimedb_type, Config)),
BridgeId = emqx_bridge_resource:bridge_id(Type, GreptimedbName), BridgeId = emqx_bridge_resource:bridge_id(Type, GreptimedbName),
@ -367,7 +366,9 @@ query_by_clientid(Topic, ClientId, Config) ->
_ -> _ ->
%% Table not found %% Table not found
#{} #{}
end end;
Error ->
{error, Error}
end. end.
make_row(null, _Rows) -> make_row(null, _Rows) ->

View File

@ -213,7 +213,8 @@ defmodule EMQXUmbrella.MixProject do
{:crc32cer, "0.1.8", override: true}, {:crc32cer, "0.1.8", override: true},
{:supervisor3, "1.1.12", override: true}, {:supervisor3, "1.1.12", override: true},
{:opentsdb, github: "emqx/opentsdb-client-erl", tag: "v0.5.1", override: true}, {:opentsdb, github: "emqx/opentsdb-client-erl", tag: "v0.5.1", override: true},
{:greptimedb, github: "GreptimeTeam/greptimedb-client-erl", tag: "v0.1.7", override: true}, {:greptimedb,
github: "GreptimeTeam/greptimedb-ingester-erl", tag: "v0.1.8", override: true},
# The following two are dependencies of rabbit_common. They are needed here to # The following two are dependencies of rabbit_common. They are needed here to
# make mix not complain about conflicting versions # make mix not complain about conflicting versions
{:thoas, github: "emqx/thoas", tag: "v1.0.0", override: true}, {:thoas, github: "emqx/thoas", tag: "v1.0.0", override: true},