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

Re-work on adding template support for Pinot Ingestion Job Spec #5372

Merged
merged 2 commits into from May 13, 2020

Conversation

xiangfu0
Copy link
Contributor

@xiangfu0 xiangfu0 commented May 12, 2020

This is the re-work of #5330, as the previous PR #5341 is reverted in #5366.

Templating is based on Groovy SimpleTemplateEngine.

we need to support Pinot Ingestion job take an ingestion job spec template file and passing thru values.

This will make user to schedule daily job simpler, without generating new yaml file everyday.

  • Adding groovy template render support for Pinot.
  • Adding -propertyFile parameter in LaunchDataIngestionJobCommand (in format of 'k1=v1' 'k2=v2'...) which will be the context to set in the template.
  • Adding -values parameter in LaunchDataIngestionJobCommand which takes a list of parameters(in format of 'k1=v1' 'k2=v2'...) that will override the context read from the propertyFile and set to the template.
  • The template ingestion spec file will be rendered to final ingestion spec with the given context values.
  • Adding support for default values today, yesterday into context for dev simplicity.

Usage example:
User can define inputDirURI as 'file:///path/to/input/${year}/${month}/${day}/${hour}'
in job spec and a config file job.config contains:

year=2020
month=05
day=01
hour=00

Then the new command line is :

bin/pinot-admin.sh LaunchDataIngestionJob  \
-jobSpecFile ingestionJobSpec.yaml \
-propertyFile job.confg \
-values day=06 hour=07

After that the real ingestion spec passed to ingestion job will have inputDirURI as 'file:///path/to/input/2020/05/06/07'

public static Map<String, Object> getDefaultContextMap() {
Map<String, Object> defaultContextMap = new HashMap<>();
Instant now = Instant.now();
defaultContextMap.put("today", DATE_FORMAT.format(new Date(now.toEpochMilli())));
Copy link
Contributor

Choose a reason for hiding this comment

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

How about LATEST?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can add. What do you expect the value for LATEST? same as TODAY?

@codecov-io
Copy link

Codecov Report

Merging #5372 into master will decrease coverage by 21.96%.
The diff coverage is 30.82%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #5372       +/-   ##
===========================================
- Coverage   66.44%   44.48%   -21.97%     
===========================================
  Files        1075     1080        +5     
  Lines       54773    55123      +350     
  Branches     8168     8249       +81     
===========================================
- Hits        36396    24519    -11877     
- Misses      15700    28507    +12807     
+ Partials     2677     2097      -580     
Impacted Files Coverage Δ
...data/manager/realtime/DefaultSegmentCommitter.java 80.00% <ø> (ø)
...e/data/manager/realtime/SplitSegmentCommitter.java 63.63% <ø> (ø)
...inot/core/query/aggregation/ThetaSketchParams.java 0.00% <0.00%> (ø)
...ation/function/AggregationFunctionVisitorBase.java 0.00% <0.00%> (ø)
...n/DistinctCountThetaSketchAggregationFunction.java 0.00% <0.00%> (ø)
...e/startree/v2/builder/StarTreeV2BuilderConfig.java 24.09% <0.00%> (-17.58%) ⬇️
...pache/pinot/plugin/inputformat/avro/AvroUtils.java 0.00% <0.00%> (-66.95%) ⬇️
.../apache/pinot/spi/config/table/IndexingConfig.java 0.00% <0.00%> (-92.31%) ⬇️
...he/pinot/spi/config/table/StarTreeIndexConfig.java 0.00% <ø> (ø)
...main/java/org/apache/pinot/spi/data/FieldSpec.java 0.00% <0.00%> (-86.26%) ⬇️
... and 617 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29ac151...aa54768. Read the comment docs.

@xiangfu0 xiangfu0 merged commit 8bd7a4b into master May 13, 2020
@xiangfu0 xiangfu0 deleted the template_ingestion_spec branch May 13, 2020 05:26
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.

None yet

5 participants