1
0

Add changes for presto mor queries (#1578)

Adds the neccessary changes to hudi for support of presto querying hudi
merge-on-read table's realtime view.

Co-authored-by: Brandon Scheller <bschelle@amazon.com>
This commit is contained in:
bschell
2020-05-04 11:27:14 -07:00
committed by GitHub
parent 5e0f5e5521
commit e21441ad83
4 changed files with 79 additions and 2 deletions

View File

@@ -19,7 +19,7 @@
package org.apache.hudi.hadoop;
import org.junit.jupiter.api.Test;
import org.apache.hudi.hadoop.realtime.HoodieParquetRealtimeInputFormat;
import java.lang.annotation.Annotation;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -27,7 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class TestAnnotation {
@Test
public void testAnnotation() {
public void testHoodieParquetInputFormatAnnotation() {
assertTrue(HoodieParquetInputFormat.class.isAnnotationPresent(UseFileSplitsFromInputFormat.class));
Annotation[] annotations = HoodieParquetInputFormat.class.getAnnotations();
boolean found = false;
@@ -38,4 +38,23 @@ public class TestAnnotation {
}
assertTrue(found);
}
@Test
public void testHoodieParquetRealtimeInputFormatAnnotations() {
assertTrue(HoodieParquetRealtimeInputFormat.class.isAnnotationPresent(UseFileSplitsFromInputFormat.class));
assertTrue(HoodieParquetRealtimeInputFormat.class.isAnnotationPresent(UseRecordReaderFromInputFormat.class));
Annotation[] annotations = HoodieParquetRealtimeInputFormat.class.getAnnotations();
boolean foundFileSplitsAnnotation = false;
boolean foundRecordReaderAnnotation = false;
for (Annotation annotation : annotations) {
if ("UseFileSplitsFromInputFormat".equals(annotation.annotationType().getSimpleName())) {
foundFileSplitsAnnotation = true;
}
if ("UseRecordReaderFromInputFormat".equals(annotation.annotationType().getSimpleName())) {
foundRecordReaderAnnotation = true;
}
}
assertTrue(foundFileSplitsAnnotation);
assertTrue(foundRecordReaderAnnotation);
}
}