Jiabao-Sun commented on code in PR #1:
URL:
https://github.com/apache/flink-connector-mongodb/pull/1#discussion_r1052217885
##########
flink-connector-mongodb/src/test/java/org/apache/flink/connector/mongodb/table/converter/MongoConvertersTest.java:
##########
@@ -146,28 +146,31 @@ public void testConvertBsonToRowData() {
GenericRowData.of(
StringData.fromString(oid.toHexString()),
StringData.fromString("string"),
- StringData.fromString(uuid.toString()),
+ StringData.fromString(
+ "{\"_value\": {\"$binary\": {\"base64\":
\"gR+qXamERr+L0IyxvO9daQ==\", \"subType\": \"04\"}}}"),
2,
3L,
4.1d,
DecimalData.fromBigDecimal(new BigDecimal("5.1"), 10,
2),
false,
TimestampData.fromEpochMillis(now.getEpochSecond() *
1000),
+ TimestampData.fromEpochMillis(now.toEpochMilli()),
StringData.fromString(
- OffsetDateTime.ofInstant(
-
Instant.ofEpochMilli(now.toEpochMilli()),
- ZoneOffset.UTC)
- .format(ISO_OFFSET_DATE_TIME)),
- StringData.fromString("/^9$/i"),
- StringData.fromString("function() { return 10; }"),
- StringData.fromString("function() { return 11; }"),
- StringData.fromString("12"),
- StringData.fromString(oid.toHexString()),
+ "{\"_value\": {\"$regularExpression\":
{\"pattern\": \"^9$\", \"options\": \"i\"}}}"),
Review Comment:
No matter which form it is, it cannot be directly handed over to MongoDB for
processing. The bson document stored in mongodb needs to be converted into
`BsonDocument`. We need to extract and convert the `RowData` fileds stored as
string types, and finally convert the entire `RowData` into `BsonDocument`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]