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

logicalType date not correctly indexed #232

Open
cb-tomvr opened this issue Aug 30, 2023 · 0 comments
Open

logicalType date not correctly indexed #232

cb-tomvr opened this issue Aug 30, 2023 · 0 comments

Comments

@cb-tomvr
Copy link

We are using the opensearch connector to sink AVRO records to elasticsearch.

Our AVRO schema looks like this.

{
    "type": "record",
    "name": "Task",
    "fields": [
        {
            "name": "id",
            "type": "string"
        },
        {
            "name": "assigned_to",
            "type": "string"
        },
        {
            "name": "deadline",
            "type": [
                "null",
                {
                    "type": "int",
                    "name": "org.apache.kafka.connect.data.Date",
                    "logicalType": "date"
                }
            ],
            "default": null
        }
    ]
}

The mapping of the deadline property in opensearch is correct

        "deadline": {
          "type": "date"
        }

However, when indexing a record, the days since epoch value is sent to elasticsearch, which is not properly handled by opensearch

{
 ...,
  "_source": {
    "id": "7d9391d6-bc2c-44ce-868a-92095b9ebb01",
    "assigned_to": "953e361e-2507-435e-afcf-4a060c958e97",
    "deadline": 19594,
  },
  "fields": {
    "deadline": [
      "1970-01-01T00:00:19.594Z"
    ]
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant