Skip to content
This repository was archived by the owner on Jan 29, 2022. It is now read-only.

Commit 061016f

Browse files
author
Peter Ableda
committed
Add support for fields starting with underscore
1 parent 928691c commit 061016f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pig/src/main/java/com/mongodb/hadoop/pig/MongoInsertStorage.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ protected void writeField(final BasicDBObjectBuilder builder,
7474
if (field.getName() != null && field.getName().equals(this.idField)) {
7575
builder.add("_id", convertedType);
7676
} else {
77-
builder.add(field.getName(), convertedType);
77+
if (field.getName() != null && field.getName().startsWith("underscore_")) {
78+
builder.add(field.getName().replace("underscore", ""), convertedType);
79+
} else {
80+
builder.add(field.getName(), convertedType);
81+
}
7882
}
7983

8084
}

0 commit comments

Comments
 (0)