pkumarsinha commented on a change in pull request #1225:
URL: https://github.com/apache/hive/pull/1225#discussion_r453587433
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/events/InsertHandler.java
##########
@@ -76,16 +77,29 @@ public void handle(Context withinContext) throws Exception {
withinContext.hiveConf);
Iterable<String> files = eventMessage.getFiles();
+ boolean copyAtLoad =
withinContext.hiveConf.getBoolVar(HiveConf.ConfVars.REPL_DATA_COPY_LAZY);
+
/*
* Insert into/overwrite operation shall operate on one or more
partitions or even partitions from multiple tables.
* But, Insert event is generated for each partition to which the data is
inserted.
* So, qlPtns list will have only one entry.
*/
Partition ptn = (null == qlPtns || qlPtns.isEmpty()) ? null :
qlPtns.get(0);
if (files != null) {
- // encoded filename/checksum of files, write into _files
- for (String file : files) {
- writeFileEntry(qlMdTable, ptn, file, withinContext);
+ if (copyAtLoad) {
+ // encoded filename/checksum of files, write into _files
+ Path dataPath = null;
+ if ((null == qlPtns) || qlPtns.isEmpty()) {
+ dataPath = new Path(withinContext.eventRoot,
EximUtil.DATA_PATH_NAME);
+ } else {
+ dataPath = new Path(withinContext.eventRoot, EximUtil.DATA_PATH_NAME
+ File.separator
Review comment:
Will have to create multiple Path object and hence not preferring.
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/DirCopyWork.java
##########
@@ -51,4 +56,20 @@ public Path getFullyQualifiedSourcePath() {
public Path getFullyQualifiedTargetPath() {
return fullyQualifiedTargetPath;
}
+
+ @Override
+ public String convertToString() {
+ StringBuilder objInStr = new StringBuilder();
+ objInStr.append(fullyQualifiedSourcePath)
+ .append(URI_SEPARATOR)
+ .append(fullyQualifiedTargetPath);
+ return objInStr.toString();
+ }
+
+ @Override
+ public void loadFromString(String objectInStr) {
Review comment:
no
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/events/CommitTxnHandler.java
##########
@@ -81,10 +88,13 @@ private void createDumpFile(Context withinContext,
org.apache.hadoop.hive.ql.met
withinContext.hiveConf);
if ((null == qlPtns) || qlPtns.isEmpty()) {
- writeDumpFiles(qlMdTable, null, fileListArray.get(0), withinContext);
+ Path dataPath = new Path(withinContext.eventRoot,
EximUtil.DATA_PATH_NAME);
+ writeDumpFiles(qlMdTable, null, fileListArray.get(0), withinContext,
dataPath);
} else {
for (int idx = 0; idx < qlPtns.size(); idx++) {
- writeDumpFiles(qlMdTable, qlPtns.get(idx), fileListArray.get(idx),
withinContext);
+ Path dataPath = new Path(withinContext.eventRoot,
EximUtil.DATA_PATH_NAME + File.separator
Review comment:
Will have to create multiple Path object and hence not preferring.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]