trino icon indicating copy to clipboard operation
trino copied to clipboard

Elasticsearch connector supports custom date formats

Open borderlayout opened this issue 2 years ago • 1 comments

Description

The current Elasticsearch Connector does not support custom date formats. When query such types, they are automatically skipped. This PR supports custom date formats.

Additional context and related issues

Please review the previous code comments below: class: io.trino.plugin.elasticsearch.ElasticsearchMetadata function: TypeAndDecoder toTrino(String prefix, IndexMetadata.Field field) line: 328 comments: // otherwise, skip -- we don't support custom formats, yet image

Release notes

(x) This is not user-visible or is docs only, and no release notes are required. ( ) Release notes are required. Please propose a release note for me. ( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. Elasticsearch connector supports custom date type formats

borderlayout avatar Feb 17 '24 08:02 borderlayout

There's an existing PR #14925. Please coordinate with @ysn2233

ebyhr avatar Feb 17 '24 12:02 ebyhr

Hi @ebyhr and @ysn2233 , I see the PR14925 was closed last week . I have already compared the differences between these two PRs. The main difference is whether to set the default parsing format. In my PR, I retain the previous parsing code and add new format. The code only affects the changes of the new format. Do you have any suggestions? Thanks

public void decode(SearchHit hit, Supplier<Object> getter, BlockBuilder output)
{
    if (pattern == null || pattern.isEmpty()) {
        // previous code, no change.
        // it supports no formats timestamp 
    }
    else {
        // the new code only here
        // it supports timestamp with formats 
    }
}

image

There's an existing PR #14925. Please coordinate with @ysn2233

borderlayout avatar Mar 06 '24 10:03 borderlayout

the closed one was moved to https://github.com/trinodb/trino/pull/20759

hashhar avatar Mar 06 '24 11:03 hashhar

the closed one was moved to #20759

OK, Thanks. I just found it.

borderlayout avatar Mar 06 '24 11:03 borderlayout

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

github-actions[bot] avatar Mar 27 '24 17:03 github-actions[bot]

Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time.

github-actions[bot] avatar Apr 17 '24 18:04 github-actions[bot]