Skip to content

Commit

Permalink
fix: log mappings error
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinyouzeng committed Apr 22, 2024
1 parent 90f2f1c commit cb895fe
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ private static string CombineOrs(string sql, IEnumerable<string> ors, string? or
public static List<MappingResponseDto> GetMapping(this IDbConnection dbConnection, bool isLog)
{
var type = isLog ? "log" : "trace";
var result = dbConnection.Query($"select DISTINCT Name from otel_mapping Array join Name where `Type`='{type}_basic' order by Name", default, ConvertToMapping);
var result = dbConnection.Query($"select DISTINCT Name from {MasaStackClickhouseConnection.MappingTable} Array join Name where `Type`='{type}_basic' order by Name", default, ConvertToMapping);
if (result == null || result.Count == 0)
return default!;

var attributes = dbConnection.Query($"select DISTINCT concat('{ATTRIBUTE_KEY}',Name) from otel_mapping Array join Name where `Type`='{type}_attributes' order by Name", default, ConvertToMapping);
var resources = dbConnection.Query($"select DISTINCT concat('{RESOURCE_KEY}',Name) from otel_mapping Array join Name where `Type`='resource' order by Name", default, ConvertToMapping);
var attributes = dbConnection.Query($"select DISTINCT concat('{ATTRIBUTE_KEY}',Name) from {MasaStackClickhouseConnection.MappingTable} Array join Name where `Type`='{type}_attributes' order by Name", default, ConvertToMapping);
var resources = dbConnection.Query($"select DISTINCT concat('{RESOURCE_KEY}',Name) from {MasaStackClickhouseConnection.MappingTable} Array join Name where `Type`='resource' order by Name", default, ConvertToMapping);
if (attributes != null && attributes.Count > 0) result.AddRange(attributes);
if (resources != null && resources.Count > 0) result.AddRange(resources);

Expand Down

0 comments on commit cb895fe

Please sign in to comment.