Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/inserts-stream endpoint does not support insertion of nested types #5620

Closed
vcrfxia opened this issue Jun 12, 2020 · 0 comments
Closed

/inserts-stream endpoint does not support insertion of nested types #5620

vcrfxia opened this issue Jun 12, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@vcrfxia
Copy link
Contributor

vcrfxia commented Jun 12, 2020

Describe the bug

The /inserts-stream endpoint throws an error when trying to insert a row containing a struct column.

To Reproduce

This bug has been present since the /inserts-stream endpoint was introduced. The fix will be in 0.10.0 and 6.0.

  • Create stream with struct type column
  • Send request to insert row into stream via /inserts-stream, either via REST endpoint or Java client

Expected behavior

The insert should succeed.

Actual behaviour

The insert attempt fails. The exact error differs depending on whether the server contains #5469 or not. On later versions the error is

[2020-06-10 12:38:18,107] ERROR Error in processing inserts (io.confluent.ksql.api.server.AcksSubscriber:100)
io.confluent.ksql.api.server.KsqlApiException: Can't coerce a field of type class java.util.LinkedHashMap ({g1=foo}) into type STRUCT<`G1` STRING>
	at io.confluent.ksql.api.impl.KeyValueExtractor.lambda$coerceObject$0(KeyValueExtractor.java:102)
	at java.util.Optional.orElseThrow(Optional.java:290)
	at io.confluent.ksql.schema.ksql.SqlValueCoercer$Result.orElseThrow(SqlValueCoercer.java:68)
	at io.confluent.ksql.api.impl.KeyValueExtractor.coerceObject(KeyValueExtractor.java:101)
	at io.confluent.ksql.api.impl.KeyValueExtractor.extractValues(KeyValueExtractor.java:66)
	at io.confluent.ksql.api.impl.InsertsSubscriber.extractValues(InsertsSubscriber.java:193)
	at io.confluent.ksql.api.impl.InsertsSubscriber.handleValue(InsertsSubscriber.java:139)
	at io.confluent.ksql.api.impl.InsertsSubscriber.handleValue(InsertsSubscriber.java:51)
	at io.confluent.ksql.reactive.BaseSubscriber.doOnNext(BaseSubscriber.java:191)
	at io.confluent.ksql.reactive.BaseSubscriber.lambda$onNext$1(BaseSubscriber.java:67)
	at io.confluent.ksql.reactive.BaseSubscriber.runOnRightContext(BaseSubscriber.java:153)
	at io.confluent.ksql.reactive.BaseSubscriber.onNext(BaseSubscriber.java:67)
	at io.confluent.ksql.reactive.BasePublisher.doOnNext(BasePublisher.java:106)
	at io.confluent.ksql.reactive.BufferedPublisher.maybeSend(BufferedPublisher.java:149)
	at io.confluent.ksql.reactive.BasePublisher.doRequest(BasePublisher.java:182)
	at io.confluent.ksql.reactive.BasePublisher.access$200(BasePublisher.java:32)
	at io.confluent.ksql.reactive.BasePublisher$Sub.lambda$request$0(BasePublisher.java:200)
	at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369)
	at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)

Additional context

Prior to #5469, there was a similar issue for array and map type columns. #5469 fixed the issue for array and map but not struct.

@vcrfxia vcrfxia added the bug label Jun 12, 2020
@vcrfxia vcrfxia added this to the 0.11.0 milestone Jun 12, 2020
@vcrfxia vcrfxia self-assigned this Jun 12, 2020
@vcrfxia vcrfxia changed the title /inserts-stream endpoint does not support insertion of nested types, e.g., struct /inserts-stream endpoint does not support insertion of nested types Jun 12, 2020
@vcrfxia vcrfxia closed this as completed Jun 17, 2020
@vcrfxia vcrfxia modified the milestones: 0.11.0, 0.10.0 Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant