{"action":"created","comment":{"url":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/comments/83530753","pull_request_review_id":4371225,"id":83530753,"diff_hunk":"@@ -19,28 +19,136 @@ package com.datamountaineer.streamreactor.connect.influx.writers\n import java.util.concurrent.TimeUnit\n \n import com.datamountaineer.streamreactor.connect.influx.config.InfluxSettings\n+import com.datamountaineer.streamreactor.connect.schemas.ConverterUtil\n import io.confluent.common.config.ConfigException\n-import org.apache.kafka.connect.data.Struct\n+import org.apache.kafka.connect.data.{Schema, Struct}\n import org.apache.kafka.connect.sink.SinkRecord\n import org.influxdb.InfluxDB.ConsistencyLevel\n import org.influxdb.dto.{BatchPoints, Point}\n \n+import scala.collection.JavaConversions._\n+import scala.util.Try\n \n-object InfluxBatchPointsBuilderFn {\n+\n+object InfluxBatchPointsBuilderFn extends ConverterUtil {\n   def apply(records: Seq[SinkRecord],\n             settings: InfluxSettings): BatchPoints = {\n+\n+    def handleSinkRecord(record: SinkRecord): Option[Point] = {\n+\n+      Option(record.valueSchema()) match {\n+        case None =>\n+          //try to take it as string\n+          record.value() match {\n+            case map: java.util.Map[_, _] => buildPointFromMap(record, settings)\n+            case _ => sys.error(\"For schemaless record only String and Map types are supported\")","path":"kafka-connect-influxdb/src/main/scala/com/datamountaineer/streamreactor/connect/influx/writers/InfluxBatchPointsBuilderFn.scala","position":28,"original_position":28,"commit_id":"e2c4fa71974706436fb892e22948fbe9ac8bdb2a","original_commit_id":"e2c4fa71974706436fb892e22948fbe9ac8bdb2a","user":{"login":"stheppi","id":2507367,"avatar_url":"https://avatars.githubusercontent.com/u/2507367?v=3","gravatar_id":"","url":"https://api.github.com/users/stheppi","html_url":"https://github.com/stheppi","followers_url":"https://api.github.com/users/stheppi/followers","following_url":"https://api.github.com/users/stheppi/following{/other_user}","gists_url":"https://api.github.com/users/stheppi/gists{/gist_id}","starred_url":"https://api.github.com/users/stheppi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stheppi/subscriptions","organizations_url":"https://api.github.com/users/stheppi/orgs","repos_url":"https://api.github.com/users/stheppi/repos","events_url":"https://api.github.com/users/stheppi/events{/privacy}","received_events_url":"https://api.github.com/users/stheppi/received_events","type":"User","site_admin":false},"body":"Ant, take a look at the else branch. if you don't have a schema, and you send a json and use JsonConverter you get back a java.util.Map.  the logic there is correct. If you send an int/long/Boolean what would you insert it against in influx? ","created_at":"2016-10-15T11:52:32Z","updated_at":"2016-10-15T11:52:32Z","html_url":"https://github.com/datamountaineer/stream-reactor/pull/68#discussion_r83530753","pull_request_url":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/68","_links":{"self":{"href":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/comments/83530753"},"html":{"href":"https://github.com/datamountaineer/stream-reactor/pull/68#discussion_r83530753"},"pull_request":{"href":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/68","id":89471516,"html_url":"https://github.com/datamountaineer/stream-reactor/pull/68","diff_url":"https://github.com/datamountaineer/stream-reactor/pull/68.diff","patch_url":"https://github.com/datamountaineer/stream-reactor/pull/68.patch","issue_url":"https://api.github.com/repos/datamountaineer/stream-reactor/issues/68","number":68,"state":"open","locked":false,"title":"supportning non avro messages","user":{"login":"stheppi","id":2507367,"avatar_url":"https://avatars.githubusercontent.com/u/2507367?v=3","gravatar_id":"","url":"https://api.github.com/users/stheppi","html_url":"https://github.com/stheppi","followers_url":"https://api.github.com/users/stheppi/followers","following_url":"https://api.github.com/users/stheppi/following{/other_user}","gists_url":"https://api.github.com/users/stheppi/gists{/gist_id}","starred_url":"https://api.github.com/users/stheppi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stheppi/subscriptions","organizations_url":"https://api.github.com/users/stheppi/orgs","repos_url":"https://api.github.com/users/stheppi/repos","events_url":"https://api.github.com/users/stheppi/events{/privacy}","received_events_url":"https://api.github.com/users/stheppi/received_events","type":"User","site_admin":false},"body":"adding support for schemaless sink record or a  record with string schema and json payload","created_at":"2016-10-14T23:41:51Z","updated_at":"2016-10-15T11:52:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5742db67f724d451608e97dced0196fd60125620","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/68/commits","review_comments_url":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/68/comments","review_comment_url":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datamountaineer/stream-reactor/issues/68/comments","statuses_url":"https://api.github.com/repos/datamountaineer/stream-reactor/statuses/e2c4fa71974706436fb892e22948fbe9ac8bdb2a","head":{"label":"datamountaineer:influx_no_struct","ref":"influx_no_struct","sha":"e2c4fa71974706436fb892e22948fbe9ac8bdb2a","user":{"login":"datamountaineer","id":17763365,"avatar_url":"https://avatars.githubusercontent.com/u/17763365?v=3","gravatar_id":"","url":"https://api.github.com/users/datamountaineer","html_url":"https://github.com/datamountaineer","followers_url":"https://api.github.com/users/datamountaineer/followers","following_url":"https://api.github.com/users/datamountaineer/following{/other_user}","gists_url":"https://api.github.com/users/datamountaineer/gists{/gist_id}","starred_url":"https://api.github.com/users/datamountaineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datamountaineer/subscriptions","organizations_url":"https://api.github.com/users/datamountaineer/orgs","repos_url":"https://api.github.com/users/datamountaineer/repos","events_url":"https://api.github.com/users/datamountaineer/events{/privacy}","received_events_url":"https://api.github.com/users/datamountaineer/received_events","type":"Organization","site_admin":false},"repo":{"id":49836805,"name":"stream-reactor","full_name":"datamountaineer/stream-reactor","owner":{"login":"datamountaineer","id":17763365,"avatar_url":"https://avatars.githubusercontent.com/u/17763365?v=3","gravatar_id":"","url":"https://api.github.com/users/datamountaineer","html_url":"https://github.com/datamountaineer","followers_url":"https://api.github.com/users/datamountaineer/followers","following_url":"https://api.github.com/users/datamountaineer/following{/other_user}","gists_url":"https://api.github.com/users/datamountaineer/gists{/gist_id}","starred_url":"https://api.github.com/users/datamountaineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datamountaineer/subscriptions","organizations_url":"https://api.github.com/users/datamountaineer/orgs","repos_url":"https://api.github.com/users/datamountaineer/repos","events_url":"https://api.github.com/users/datamountaineer/events{/privacy}","received_events_url":"https://api.github.com/users/datamountaineer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datamountaineer/stream-reactor","description":"Streaming reference architecture built around Kafka. ","fork":false,"url":"https://api.github.com/repos/datamountaineer/stream-reactor","forks_url":"https://api.github.com/repos/datamountaineer/stream-reactor/forks","keys_url":"https://api.github.com/repos/datamountaineer/stream-reactor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datamountaineer/stream-reactor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datamountaineer/stream-reactor/teams","hooks_url":"https://api.github.com/repos/datamountaineer/stream-reactor/hooks","issue_events_url":"https://api.github.com/repos/datamountaineer/stream-reactor/issues/events{/number}","events_url":"https://api.github.com/repos/datamountaineer/stream-reactor/events","assignees_url":"https://api.github.com/repos/datamountaineer/stream-reactor/assignees{/user}","branches_url":"https://api.github.com/repos/datamountaineer/stream-reactor/branches{/branch}","tags_url":"https://api.github.com/repos/datamountaineer/stream-reactor/tags","blobs_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/refs{/sha}","trees_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datamountaineer/stream-reactor/statuses/{sha}","languages_url":"https://api.github.com/repos/datamountaineer/stream-reactor/languages","stargazers_url":"https://api.github.com/repos/datamountaineer/stream-reactor/stargazers","contributors_url":"https://api.github.com/repos/datamountaineer/stream-reactor/contributors","subscribers_url":"https://api.github.com/repos/datamountaineer/stream-reactor/subscribers","subscription_url":"https://api.github.com/repos/datamountaineer/stream-reactor/subscription","commits_url":"https://api.github.com/repos/datamountaineer/stream-reactor/commits{/sha}","git_commits_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/commits{/sha}","comments_url":"https://api.github.com/repos/datamountaineer/stream-reactor/comments{/number}","issue_comment_url":"https://api.github.com/repos/datamountaineer/stream-reactor/issues/comments{/number}","contents_url":"https://api.github.com/repos/datamountaineer/stream-reactor/contents/{+path}","compare_url":"https://api.github.com/repos/datamountaineer/stream-reactor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datamountaineer/stream-reactor/merges","archive_url":"https://api.github.com/repos/datamountaineer/stream-reactor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datamountaineer/stream-reactor/downloads","issues_url":"https://api.github.com/repos/datamountaineer/stream-reactor/issues{/number}","pulls_url":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls{/number}","milestones_url":"https://api.github.com/repos/datamountaineer/stream-reactor/milestones{/number}","notifications_url":"https://api.github.com/repos/datamountaineer/stream-reactor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datamountaineer/stream-reactor/labels{/name}","releases_url":"https://api.github.com/repos/datamountaineer/stream-reactor/releases{/id}","deployments_url":"https://api.github.com/repos/datamountaineer/stream-reactor/deployments","created_at":"2016-01-17T21:37:58Z","updated_at":"2016-10-12T10:38:35Z","pushed_at":"2016-10-14T23:41:51Z","git_url":"git://github.com/datamountaineer/stream-reactor.git","ssh_url":"git@github.com:datamountaineer/stream-reactor.git","clone_url":"https://github.com/datamountaineer/stream-reactor.git","svn_url":"https://github.com/datamountaineer/stream-reactor","homepage":"http://datamountaineer.com/2016/01/12/streamliner/","size":3443,"stargazers_count":89,"watchers_count":89,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":14,"forks":25,"open_issues":14,"watchers":89,"default_branch":"master"}},"base":{"label":"datamountaineer:master","ref":"master","sha":"fd69a55469b00ffd0ea3e7c9a5e419c5d3aa61a1","user":{"login":"datamountaineer","id":17763365,"avatar_url":"https://avatars.githubusercontent.com/u/17763365?v=3","gravatar_id":"","url":"https://api.github.com/users/datamountaineer","html_url":"https://github.com/datamountaineer","followers_url":"https://api.github.com/users/datamountaineer/followers","following_url":"https://api.github.com/users/datamountaineer/following{/other_user}","gists_url":"https://api.github.com/users/datamountaineer/gists{/gist_id}","starred_url":"https://api.github.com/users/datamountaineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datamountaineer/subscriptions","organizations_url":"https://api.github.com/users/datamountaineer/orgs","repos_url":"https://api.github.com/users/datamountaineer/repos","events_url":"https://api.github.com/users/datamountaineer/events{/privacy}","received_events_url":"https://api.github.com/users/datamountaineer/received_events","type":"Organization","site_admin":false},"repo":{"id":49836805,"name":"stream-reactor","full_name":"datamountaineer/stream-reactor","owner":{"login":"datamountaineer","id":17763365,"avatar_url":"https://avatars.githubusercontent.com/u/17763365?v=3","gravatar_id":"","url":"https://api.github.com/users/datamountaineer","html_url":"https://github.com/datamountaineer","followers_url":"https://api.github.com/users/datamountaineer/followers","following_url":"https://api.github.com/users/datamountaineer/following{/other_user}","gists_url":"https://api.github.com/users/datamountaineer/gists{/gist_id}","starred_url":"https://api.github.com/users/datamountaineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datamountaineer/subscriptions","organizations_url":"https://api.github.com/users/datamountaineer/orgs","repos_url":"https://api.github.com/users/datamountaineer/repos","events_url":"https://api.github.com/users/datamountaineer/events{/privacy}","received_events_url":"https://api.github.com/users/datamountaineer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datamountaineer/stream-reactor","description":"Streaming reference architecture built around Kafka. ","fork":false,"url":"https://api.github.com/repos/datamountaineer/stream-reactor","forks_url":"https://api.github.com/repos/datamountaineer/stream-reactor/forks","keys_url":"https://api.github.com/repos/datamountaineer/stream-reactor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datamountaineer/stream-reactor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datamountaineer/stream-reactor/teams","hooks_url":"https://api.github.com/repos/datamountaineer/stream-reactor/hooks","issue_events_url":"https://api.github.com/repos/datamountaineer/stream-reactor/issues/events{/number}","events_url":"https://api.github.com/repos/datamountaineer/stream-reactor/events","assignees_url":"https://api.github.com/repos/datamountaineer/stream-reactor/assignees{/user}","branches_url":"https://api.github.com/repos/datamountaineer/stream-reactor/branches{/branch}","tags_url":"https://api.github.com/repos/datamountaineer/stream-reactor/tags","blobs_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/refs{/sha}","trees_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datamountaineer/stream-reactor/statuses/{sha}","languages_url":"https://api.github.com/repos/datamountaineer/stream-reactor/languages","stargazers_url":"https://api.github.com/repos/datamountaineer/stream-reactor/stargazers","contributors_url":"https://api.github.com/repos/datamountaineer/stream-reactor/contributors","subscribers_url":"https://api.github.com/repos/datamountaineer/stream-reactor/subscribers","subscription_url":"https://api.github.com/repos/datamountaineer/stream-reactor/subscription","commits_url":"https://api.github.com/repos/datamountaineer/stream-reactor/commits{/sha}","git_commits_url":"https://api.github.com/repos/datamountaineer/stream-reactor/git/commits{/sha}","comments_url":"https://api.github.com/repos/datamountaineer/stream-reactor/comments{/number}","issue_comment_url":"https://api.github.com/repos/datamountaineer/stream-reactor/issues/comments{/number}","contents_url":"https://api.github.com/repos/datamountaineer/stream-reactor/contents/{+path}","compare_url":"https://api.github.com/repos/datamountaineer/stream-reactor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datamountaineer/stream-reactor/merges","archive_url":"https://api.github.com/repos/datamountaineer/stream-reactor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datamountaineer/stream-reactor/downloads","issues_url":"https://api.github.com/repos/datamountaineer/stream-reactor/issues{/number}","pulls_url":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls{/number}","milestones_url":"https://api.github.com/repos/datamountaineer/stream-reactor/milestones{/number}","notifications_url":"https://api.github.com/repos/datamountaineer/stream-reactor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datamountaineer/stream-reactor/labels{/name}","releases_url":"https://api.github.com/repos/datamountaineer/stream-reactor/releases{/id}","deployments_url":"https://api.github.com/repos/datamountaineer/stream-reactor/deployments","created_at":"2016-01-17T21:37:58Z","updated_at":"2016-10-12T10:38:35Z","pushed_at":"2016-10-14T23:41:51Z","git_url":"git://github.com/datamountaineer/stream-reactor.git","ssh_url":"git@github.com:datamountaineer/stream-reactor.git","clone_url":"https://github.com/datamountaineer/stream-reactor.git","svn_url":"https://github.com/datamountaineer/stream-reactor","homepage":"http://datamountaineer.com/2016/01/12/streamliner/","size":3443,"stargazers_count":89,"watchers_count":89,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":14,"forks":25,"open_issues":14,"watchers":89,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/68"},"html":{"href":"https://github.com/datamountaineer/stream-reactor/pull/68"},"issue":{"href":"https://api.github.com/repos/datamountaineer/stream-reactor/issues/68"},"comments":{"href":"https://api.github.com/repos/datamountaineer/stream-reactor/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datamountaineer/stream-reactor/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/datamountaineer/stream-reactor/statuses/e2c4fa71974706436fb892e22948fbe9ac8bdb2a"}}}}
{"actor":{"display_login":"stheppi"}}