gjacoby126 commented on a change in pull request #434: PHOENIX-5018 Index
mutations created by UPSERT SELECT will have wrong…
URL: https://github.com/apache/phoenix/pull/434#discussion_r254911716
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
##########
@@ -443,17 +448,44 @@ private Job configureJobForAysncIndex(String schemaName,
String indexTable, Stri
// set input for map reduce job using hbase snapshots
PhoenixMapReduceUtil
- .setInput(job, PhoenixIndexDBWritable.class, snapshotName,
qDataTable, restoreDir, selectQuery);
+ .setInput(job, PhoenixIndexDBWritable.class,
snapshotName, qDataTable, restoreDir, selectQuery);
}
TableMapReduceUtil.initCredentials(job);
if (useDirectApi) {
- return configureSubmittableJobUsingDirectApi(job, false);
+ job.setMapperClass(PhoenixIndexImportDirectMapper.class);
+ return configureSubmittableJobUsingDirectApi(job);
} else {
return configureRunnableJobUsingBulkLoad(job, outputPath);
-
}
-
+ }
+
+ private Job configureJobForServerBuildIndex()
+ throws Exception {
+
+ PhoenixConfigurationUtil.setIndexToolDataTableName(configuration,
qDataTable);
+ PhoenixConfigurationUtil.setIndexToolIndexTableName(configuration,
qIndexTable);
+
+ String physicalIndexTable =
pIndexTable.getPhysicalName().getString();
+
+ PhoenixConfigurationUtil.setPhysicalTableName(configuration,
physicalIndexTable);
+ PhoenixConfigurationUtil.setDisableIndexes(configuration,
indexTable);
+
+ fs = outputPath.getFileSystem(configuration);
+ fs.delete(outputPath, true);
+
+ final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE,
schemaName, dataTable, indexTable);
+ final Job job = Job.getInstance(configuration, jobName);
+ job.setJarByClass(IndexTool.class);
+ job.setMapOutputKeyClass(ImmutableBytesWritable.class);
+ FileOutputFormat.setOutputPath(job, outputPath);
Review comment:
Can dispense with the output path, I think
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services