caican00 commented on code in PR #4292:
URL: https://github.com/apache/gravitino/pull/4292#discussion_r1703647186
##########
catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/GravitinoPaimonTable.java:
##########
@@ -58,20 +70,26 @@ protected TableOperations newOps() {
* @return The converted Paimon table.
*/
public Schema toPaimonTableSchema() {
- Schema.Builder builder =
Schema.newBuilder().comment(comment).options(properties);
- if (partitioning != null) {
- builder.partitionKeys(
- Arrays.stream(partitioning)
- .map(
- partition -> {
- NamedReference[] references = partition.references();
- Preconditions.checkArgument(
- references.length == 1,
- "Partitioning column must be single-column, like
'a'.");
- return references[0].toString();
- })
- .collect(Collectors.toList()));
+ Schema.Builder builder = Schema.newBuilder().comment(comment);
+ if (properties == null) {
+ properties = Maps.newHashMap();
+ }
+ if (partitioning == null) {
+ partitioning = EMPTY_PARTITIONING;
}
+ if (indexes == null) {
Review Comment:
`toPaimonTableSchema` is called in unit test, afraid that passing `null`
will cause `NPE`.
--
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]