[
https://issues.apache.org/jira/browse/BEAM-7450?focusedWorklogId=259888&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-259888
]
ASF GitHub Bot logged work on BEAM-7450:
----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Jun/19 20:27
Start Date: 13/Jun/19 20:27
Worklog Time Spent: 10m
Work Description: jhalaria commented on pull request #8718: [BEAM-7450]
Add an unbounded HcatalogIO reader using splittable pardo
URL: https://github.com/apache/beam/pull/8718#discussion_r293562373
##########
File path:
sdks/java/io/hcatalog/src/test/java/org/apache/beam/sdk/io/hcatalog/HCatalogIOTest.java
##########
@@ -163,6 +179,55 @@ public void processElement(ProcessContext c) {
readAfterWritePipeline.run();
}
+ private Map<String, String> getPartitions() {
+ Map<String, String> partitions = new HashMap<>();
+ partitions.put("load_date", "2019-05-14T23:28:04.425Z");
+ partitions.put("product_type", "1");
+ return partitions;
+ }
+
+ /** Perform end-to-end test of Write-then-Read operation. */
+ @Test
+ @NeedsEmptyTestTablesForUnboundedReads
+ public void testWriteThenUnboundedReadSuccess() throws Exception {
+
+ defaultPipeline
+ .apply(Create.of(buildHCatRecords(TEST_RECORDS_COUNT)))
+ .apply(
+ HCatalogIO.write()
+
.withConfigProperties(getConfigPropertiesAsMap(service.getHiveConf()))
+ .withDatabase(TEST_DATABASE)
+ .withTable(TEST_TABLE)
+ .withPartition(getPartitions())
+ .withBatchSize(512L));
+ defaultPipeline.run();
+ final ImmutableList<String> partitions = ImmutableList.of("load_date",
"product_type");
+ final PCollection<HCatRecord> data =
+ readAfterWritePipeline
+ .apply(
+ "ReadData",
+ HCatalogIO.read()
+
.withConfigProperties(getConfigPropertiesAsMap(service.getHiveConf()))
+ .withDatabase(TEST_DATABASE)
+ .withPartitionCols(partitions)
+ .withTable(TEST_TABLE)
+ .withPollingInterval(Duration.millis(15000)))
Review comment:
It didn't earlier. Added the ability to specify a termination condition
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 259888)
Time Spent: 7h 40m (was: 7.5h)
> Unbounded HCatalogIO Reader using splittable pardos
> ---------------------------------------------------
>
> Key: BEAM-7450
> URL: https://issues.apache.org/jira/browse/BEAM-7450
> Project: Beam
> Issue Type: New Feature
> Components: sdk-java-core
> Reporter: Ankit Jhalaria
> Assignee: Ankit Jhalaria
> Priority: Minor
> Time Spent: 7h 40m
> Remaining Estimate: 0h
>
> # Current version of HcatalogIO is a bounded source.
> # While migrating our jobs to aws, we realized that it would be helpful to
> have an unbounded hcat reader that can behave as an unbounded source and
> polls for new partitions as and when they become available.
> # I have used splittable pardo(s) to do this. There is a flag that can be
> set to treat this as a bounded source which will terminate if that flag is
> set.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)