szlta commented on a change in pull request #1251:
URL: https://github.com/apache/hive/pull/1251#discussion_r454393621
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java
##########
@@ -129,6 +137,16 @@
*/
private SearchArgument deleteEventSarg = null;
+ /**
+ * Cachetag associated with the Split
+ */
+ private final CacheTag cacheTag;
+
+ /**
+ * Skip using Llap IO cache for checking delete_delta files if the
configuration is not correct
+ */
+ private static boolean skipLlapCache = true;
Review comment:
Initialized to true on purpose for now? If not, I don't see it getting
set to false.
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java
##########
@@ -1562,20 +1580,31 @@ public int compareTo(CompressedOwid other) {
try {
final Path[] deleteDeltaDirs = getDeleteDeltaDirsFromSplit(orcSplit);
if (deleteDeltaDirs.length > 0) {
+ FileSystem fs = orcSplit.getPath().getFileSystem(conf);
+ AcidOutputFormat.Options orcSplitMinMaxWriteIds =
+ AcidUtils.parseBaseOrDeltaBucketFilename(orcSplit.getPath(),
conf);
int totalDeleteEventCount = 0;
for (Path deleteDeltaDir : deleteDeltaDirs) {
- FileSystem fs = deleteDeltaDir.getFileSystem(conf);
+ if (!isQualifiedDeleteDeltaForSplit(orcSplitMinMaxWriteIds,
deleteDeltaDir)) {
+ continue;
+ }
Path[] deleteDeltaFiles =
OrcRawRecordMerger.getDeltaFiles(deleteDeltaDir, bucket,
new OrcRawRecordMerger.Options().isCompacting(false), null);
for (Path deleteDeltaFile : deleteDeltaFiles) {
try {
- /**
- * todo: we have OrcSplit.orcTail so we should be able to get
stats from there
- */
- Reader deleteDeltaReader =
OrcFile.createReader(deleteDeltaFile, OrcFile.readerOptions(conf));
- if (deleteDeltaReader.getNumberOfRows() <= 0) {
+ ReaderData readerData = getOrcTail(deleteDeltaFile, conf,
cacheTag);
+ OrcTail orcTail = readerData.orcTail;
+ if (orcTail.getFooter().getNumberOfRows() <= 0) {
continue; // just a safe check to ensure that we are not
reading empty delete files.
}
+ OrcRawRecordMerger.KeyInterval deleteKeyInterval =
findDeleteMinMaxKeys(orcTail, deleteDeltaFile);
+ if (!deleteKeyInterval.isIntersects(keyInterval)) {
+ // If there is no intersection between data and delete
delta, do not read delete file
+ continue;
+ }
+ // Create the reader if we got the OrcTail from cache
Review comment:
nit: comment could be more verbose, like: Reader can be reused if it was
created before: only for non-LLAP cache cases, otherwise we need to create it
here
----------------------------------------------------------------
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]