codope commented on code in PR #9834:
URL: https://github.com/apache/hudi/pull/9834#discussion_r1351799159
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/SanitizationUtils.java:
##########
@@ -120,6 +120,11 @@ public static Dataset<Row>
sanitizeColumnNamesForAvro(Dataset<Row> inputDataset,
return targetDataset;
}
+ public static Dataset<Row> sanitizeColumnNamesForAvro(Dataset<Row>
inputDataset, TypedProperties props) {
Review Comment:
Is there a unit test for this util method?
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/RowSource.java:
##########
@@ -42,9 +43,10 @@ public RowSource(TypedProperties props, JavaSparkContext
sparkContext, SparkSess
protected final InputBatch<Dataset<Row>> fetchNewData(Option<String>
lastCkptStr, long sourceLimit) {
Pair<Option<Dataset<Row>>, String> res = fetchNextBatch(lastCkptStr,
sourceLimit);
return res.getKey().map(dsr -> {
+ Dataset<Row> sanitizedDSR =
SanitizationUtils.sanitizeColumnNamesForAvro(dsr, props);
Review Comment:
What's DSR? Let's avoid abbreviations in variable names unless it's too
verbose? Maybe, here the variable name can simply be `sanitizedRows`
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/SanitizationUtils.java:
##########
@@ -120,6 +120,11 @@ public static Dataset<Row>
sanitizeColumnNamesForAvro(Dataset<Row> inputDataset,
return targetDataset;
}
+ public static Dataset<Row> sanitizeColumnNamesForAvro(Dataset<Row>
inputDataset, TypedProperties props) {
+ return getShouldSanitize(props) ? sanitizeColumnNamesForAvro(inputDataset,
getInvalidCharMask(props))
Review Comment:
rename `getShouldSanitize` to `shouldSanitize`.
--
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]