hudi-agent commented on code in PR #20354:
URL: https://github.com/apache/hudi/pull/20354#discussion_r4288015337
##########
hudi-sync/hudi-sync-common/src/main/java/org/apache/hudi/sync/common/util/SparkSchemaUtils.java:
##########
@@ -41,7 +41,8 @@ public static String convertToSparkSchemaJson(HoodieSchema
schema) {
* as {@code comment}, which spark displays as the
column comment
*/
public static String convertToSparkSchemaJson(HoodieSchema schema, boolean
includeFieldDocs) {
- String fieldsJsonString = schema.getFields().stream().map(field -> {
+ // Fields of the "null" type always hold null and are not written to the
data files, so they are skipped
+ String fieldsJsonString = schema.getFields().stream().filter(field ->
!field.schema().isSchemaNull()).map(field -> {
Review Comment:
🤖 nit: could you wrap this long stream line (e.g. put `.filter(...)` and
`.map(...)` on separate lines) so it stays readable?
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/util/HiveSchemaUtil.java:
##########
@@ -285,6 +291,14 @@ private static String
createHiveStruct(List<HoodieSchemaField> fields, boolean s
return finalStr;
}
+ /**
Review Comment:
🤖 nit: would it make sense to drop the `isNullTypeField` wrapper (or reuse
it in `SparkSchemaUtils`)? It just forwards to `isSchemaNull()` and the same
check is inlined elsewhere.
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]