{"action":"created","issue":{"url":"https://api.github.com/repos/Landoop/stream-reactor/issues/497","repository_url":"https://api.github.com/repos/Landoop/stream-reactor","labels_url":"https://api.github.com/repos/Landoop/stream-reactor/issues/497/labels{/name}","comments_url":"https://api.github.com/repos/Landoop/stream-reactor/issues/497/comments","events_url":"https://api.github.com/repos/Landoop/stream-reactor/issues/497/events","html_url":"https://github.com/Landoop/stream-reactor/issues/497","id":360074268,"node_id":"MDU6SXNzdWUzNjAwNzQyNjg=","number":497,"title":"Kudu Connector Can Not AutoCreate Table from Sink Record","user":{"login":"rad08d","id":8313498,"node_id":"MDQ6VXNlcjgzMTM0OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/8313498?v=4","gravatar_id":"","url":"https://api.github.com/users/rad08d","html_url":"https://github.com/rad08d","followers_url":"https://api.github.com/users/rad08d/followers","following_url":"https://api.github.com/users/rad08d/following{/other_user}","gists_url":"https://api.github.com/users/rad08d/gists{/gist_id}","starred_url":"https://api.github.com/users/rad08d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rad08d/subscriptions","organizations_url":"https://api.github.com/users/rad08d/orgs","repos_url":"https://api.github.com/users/rad08d/repos","events_url":"https://api.github.com/users/rad08d/events{/privacy}","received_events_url":"https://api.github.com/users/rad08d/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-13T21:32:14Z","updated_at":"2018-09-16T16:47:00Z","closed_at":"2018-09-16T16:47:00Z","author_association":"CONTRIBUTOR","body":"After POSTing a connector config like the following:\r\n```\r\n{\r\n  \"name\": \"troublesome-connector\",\r\n  \"config\": {\r\n    \"connector.class\": \"com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkConnector\",\r\n    \"connect.kudu.schema.registry.url\": \"http://schema-registry:8081\",\r\n    \"connect.kudu.kcql\": \"UPSERT INTO impala::default.troublesome-connector SELECT * FROM troublesome-connector AUTOCREATE DISTRIBUTEBY key_id INTO 5 BUCKETS AUTOEVOLVE\",\r\n    \"schema.compatibility\": \"FULL\",\r\n    \"topics\": \"troublesome-connector\",\r\n    \"tasks.max\": \"1\",\r\n    \"name\": \"troublesome-connector\",\r\n    \"connect.kudu.master\": \"kudu-master:7051\",\r\n    \"auto.create\": \"true\"\r\n  }\r\n}\r\n```\r\nand putting a record on Kafka, the Kudu connector fails to auto-create the table from the sink record (specifically, the `DBHandlercreateTableFromSinkRecord` method). I believe this is due to a lack of a primary key. The following stacktrace ensues: \r\n```\r\nconnect_1          | [2018-09-13 21:16:20,297] ERROR Encountered error must specify at least one key column (com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter)\r\nconnect_1          | org.apache.kudu.client.NonRecoverableException: must specify at least one key column\r\nconnect_1          | \tat org.apache.kudu.client.KuduException.transformException(KuduException.java:110)\r\nconnect_1          | \tat org.apache.kudu.client.KuduClient.joinAndHandleException(KuduClient.java:352)\r\nconnect_1          | \tat org.apache.kudu.client.KuduClient.createTable(KuduClient.java:96)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.DbHandler$.executeCreateTable(DbHandler.scala:334)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.DbHandler$.createTableFromSinkRecord(DbHandler.scala:309)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.applyDDLs(KuduWriter.scala:156)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.com$datamountaineer$streamreactor$connect$kudu$sink$KuduWriter$$handleSinkRecord$1(KuduWriter.scala:129)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1$$anonfun$apply$mcV$sp$1.apply(KuduWriter.scala:138)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1$$anonfun$apply$mcV$sp$1.apply(KuduWriter.scala:138)\r\nconnect_1          | \tat scala.collection.Iterator$$anon$11.next(Iterator.scala:410)\r\nconnect_1          | \tat scala.collection.Iterator$$anon$11.next(Iterator.scala:410)\r\nconnect_1          | \tat scala.collection.Iterator$GroupedIterator.takeDestructively(Iterator.scala:1074)\r\nconnect_1          | \tat scala.collection.Iterator$GroupedIterator.go(Iterator.scala:1089)\r\nconnect_1          | \tat scala.collection.Iterator$GroupedIterator.fill(Iterator.scala:1126)\r\nconnect_1          | \tat scala.collection.Iterator$GroupedIterator.hasNext(Iterator.scala:1130)\r\nconnect_1          | \tat scala.collection.Iterator$class.foreach(Iterator.scala:891)\r\nconnect_1          | \tat scala.collection.AbstractIterator.foreach(Iterator.scala:1334)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1.apply$mcV$sp(KuduWriter.scala:141)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1.apply(KuduWriter.scala:141)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1.apply(KuduWriter.scala:141)\r\nconnect_1          | \tat scala.util.Try$.apply(Try.scala:192)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.applyInsert(KuduWriter.scala:136)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.write(KuduWriter.scala:100)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkTask$$anonfun$put$2.apply(KuduSinkTask.scala:67)\r\nconnect_1          | \tat com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkTask$$anonfun$put$2.apply(KuduSinkTask.scala:67)\r\n```\r\nI took a stab at fixing this issue and have a PR to be reviewed. Will attach it to this ticket after it is filled.\r\n"},"comment":{"url":"https://api.github.com/repos/Landoop/stream-reactor/issues/comments/421794321","html_url":"https://github.com/Landoop/stream-reactor/issues/497#issuecomment-421794321","issue_url":"https://api.github.com/repos/Landoop/stream-reactor/issues/497","id":421794321,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTc5NDMyMQ==","user":{"login":"andrewstevenson","id":10235749,"node_id":"MDQ6VXNlcjEwMjM1NzQ5","avatar_url":"https://avatars2.githubusercontent.com/u/10235749?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewstevenson","html_url":"https://github.com/andrewstevenson","followers_url":"https://api.github.com/users/andrewstevenson/followers","following_url":"https://api.github.com/users/andrewstevenson/following{/other_user}","gists_url":"https://api.github.com/users/andrewstevenson/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewstevenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewstevenson/subscriptions","organizations_url":"https://api.github.com/users/andrewstevenson/orgs","repos_url":"https://api.github.com/users/andrewstevenson/repos","events_url":"https://api.github.com/users/andrewstevenson/events{/privacy}","received_events_url":"https://api.github.com/users/andrewstevenson/received_events","type":"User","site_admin":false},"created_at":"2018-09-16T16:47:00Z","updated_at":"2018-09-16T16:47:00Z","author_association":"COLLABORATOR","body":"Closed in #498"}}
{"actor":{"display_login":"andrewstevenson"}}