Skip to content

NIFI-5909 PutElasticsearchHttpRecord doesn't allow to customize the timestamp format#3227

Closed
SavtechSolutions wants to merge 7 commits intoapache:masterfrom
SavtechSolutions:NIFI-5909
Closed

NIFI-5909 PutElasticsearchHttpRecord doesn't allow to customize the timestamp format#3227
SavtechSolutions wants to merge 7 commits intoapache:masterfrom
SavtechSolutions:NIFI-5909

Conversation

@SavtechSolutions
Copy link
Contributor

@SavtechSolutions SavtechSolutions commented Dec 19, 2018

added optional settings for date, time, and timestamp formats used to write Records to Elasticsearch

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically master)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

@SavtechSolutions
Copy link
Contributor Author

SavtechSolutions commented Dec 19, 2018

No unit tests have been added/modified, as existing tests verify only the URL used to call ES, but not the content. I'm thinking of adding a callback hook to the realRequest inside PutElasticsearchHttpRecordTestProcessor.createElasticsearchClient() to do any custom content assertions

Never mind this, added the tests already

@patricker patricker changed the title NIFI-5909 NIFI-5909 PutElasticsearchHttpRecord doesn't allow to customize the timestamp format Dec 20, 2018
@patricker
Copy link
Contributor

I'm not a good reviewer for this one, but anything you can do to add test cases and improve the overall quality is appreciated, and makes it easier for current and future code changes/reviews.

@SavtechSolutions
Copy link
Contributor Author

Yes, I do plan to add them - time permitting, as there's some infrastructure coding I need to do first, to make content assertions possible.

Copy link
Contributor

@bdesert bdesert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SavtechSolutions ,
IMO, descriptions for time/date/timestamp descriptors should be consistent with existing ones. Please take a look at CSVReader for example.
Also, having expression language allowed on flow file level can cause inconsistency of date/time/timestamp data fields in ES. I would restrict it to Variable Registry level.

Also, before you commit the changes, you could run
mvn -T 2 clean install -Pcontrib-check -Ddir-only
to make sure you don't have styling issues and all tests are passing.

…scope to variable registry; added an appropriate validator along with its Maven dependency; moved format initialization to @OnScheduled
@bdesert
Copy link
Contributor

bdesert commented Jan 10, 2019

+1 LGTM. Pulled the changes and rebuilt the instance. Tested with different formats. Thank you for improvements! Merging to master.

@bdesert bdesert closed this in 3e52ae9 Jan 10, 2019
@SavtechSolutions SavtechSolutions deleted the NIFI-5909 branch January 10, 2019 13:13
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

Successfully merging this pull request may close these issues.

3 participants