-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
pinot-spi/src/main/java/org/apache/pinot/spi/ingestion/batch/IngestionJobLauncher.java
Outdated
Show resolved
Hide resolved
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()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about LATEST?
There was a problem hiding this comment.
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
?
...-tools/src/main/java/org/apache/pinot/tools/admin/command/LaunchDataIngestionJobCommand.java
Show resolved
Hide resolved
pinot-spi/src/main/java/org/apache/pinot/spi/ingestion/batch/IngestionJobLauncher.java
Show resolved
Hide resolved
dfbd372
to
077fe52
Compare
077fe52
to
aa54768
Compare
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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.
-propertyFile
parameter inLaunchDataIngestionJobCommand
(in format of 'k1=v1' 'k2=v2'...) which will be the context to set in the template.-values
parameter inLaunchDataIngestionJobCommand
which takes a list of parameters(in format of 'k1=v1' 'k2=v2'...) that will override the context read from thepropertyFile
and set to the template.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:Then the new command line is :
After that the real ingestion spec passed to ingestion job will have
inputDirURI
as'file:///path/to/input/2020/05/06/07'