question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KafkaEmitter for request emitting does not emit "queryType" for native queries

See original GitHub issue

Affected Version

The Druid version where the problem was encountered: 0.22.x, 0.23.x

Description

When setting up a request emitter to use KafkaEmitter the queryType property is not serialized to a JSON. The problem is located in the method: public void emit(final Event event) of KafkaEmitter.java.

The problem is that the rendering of the JSON string is done on the Map<String, Object>. The Jackson ignores the polymorphic annotation on the Query class with queryType if the query is serialized as a part of the map (see: DefaultRequestLogEvent for explanation). If we serialize the query independently then the polymorphic annotation is respected.

Proposed solution

The simples solution is to serialize an object to JsonNode first. If the query is present, then serialize it independently and replace the non-polymorphic version in the JsonNode.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
BartMikicommented, Aug 17, 2022

@rohangarg Thank you for the response! I’m interested in contributing, actually, I already fix the issue on my fork. I will link the PR to this Issue once I finish the unit tests. I like your idea to parse each KV pair individually, I’ll do that.

0reactions
BartMikicommented, Aug 22, 2022

@FrankChen021 I’ve updated the code with EventMap. Can you have a look?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Native queries - Apache Druid
Native queries in Druid are JSON objects and are typically issued to the Broker or Router processes. Queries can be posted like this:...
Read more >
Serialization Of Polymorphic Array Failing · Issue #699 - GitHub
#12912 Fix KafkaEmitter not emitting queryType for a native query ... KafkaEmitter for request emitting does not emit "queryType" for native ...
Read more >
How to call native SQL queries with JPA & Hibernate
All you need to know to execute native SQL statements with Hibernate, handle the query result and avoid common performance pitfalls.
Read more >
Spring boot @Query problem while using native query
I am usingCrudRepository . If i use this @Query method, it is showing this error . javax.persistence.TransactionRequiredException: Executing an ...
Read more >
Druid SQL - 《Apache Druid v0.20.1 Documentation》 - 书栈网
With the native GroupBy query type, it is pushed down when ordering on ... This means that non-commutative aggregation functions can produce ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found