Skip to content

Commit 03e4cb0

Browse files
committed
debug
1 parent 8f8a8e9 commit 03e4cb0

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

amoro-ams/src/test/java/org/apache/amoro/server/optimizing/flow/TestKeyedContinuousOptimizing.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ public static Object[] parameters() {
7777

7878
@Test
7979
public void run() throws Exception {
80+
try {
81+
System.setProperty("record_debug", "true");
82+
internalRun();
83+
} finally {
84+
System.clearProperty("record_debug");
85+
}
86+
}
87+
88+
public void internalRun() throws Exception {
8089
MixedTable table = getMixedTable();
8190

8291
int partitionCount = 2;

amoro-format-iceberg/src/main/java/org/apache/amoro/io/writer/RecordWithAction.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import org.apache.iceberg.data.Record;
2323
import org.apache.iceberg.types.Types;
2424

25+
import java.time.LocalDateTime;
26+
import java.time.OffsetDateTime;
2527
import java.util.Map;
2628

2729
public class RecordWithAction implements Record {
@@ -63,8 +65,27 @@ public Object get(int pos) {
6365
return record.get(pos);
6466
}
6567

68+
private static int count = 0;
69+
6670
@Override
6771
public <T> T get(int pos, Class<T> javaClass) {
72+
if (System.getProperty("record_debug") != null && count < 1000) {
73+
Object value = record.get(pos);
74+
if (value instanceof Long
75+
|| value instanceof LocalDateTime
76+
|| value instanceof OffsetDateTime) {
77+
System.out.println(
78+
"record_debug: pos:"
79+
+ pos
80+
+ ", value:"
81+
+ value
82+
+ ", actualClass:"
83+
+ value.getClass().getName()
84+
+ ", expectJavaClass:"
85+
+ javaClass.getName());
86+
count++;
87+
}
88+
}
6889
return record.get(pos, javaClass);
6990
}
7091

0 commit comments

Comments
 (0)