Skip to content

Commit

Permalink
Fix failure when adding column without comment in Kudu
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Apr 6, 2022
1 parent a40b3eb commit 9a30b28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import java.util.Optional;
import java.util.stream.IntStream;

import static com.google.common.base.Strings.nullToEmpty;
import static com.google.common.base.Verify.verify;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static io.trino.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR;
Expand Down Expand Up @@ -319,7 +320,7 @@ public void addColumn(SchemaTableName schemaTableName, ColumnMetadata column)
new ColumnSchemaBuilder(column.getName(), type)
.nullable(true)
.defaultValue(null)
.comment(column.getComment())
.comment(nullToEmpty(column.getComment())) // Kudu doesn't allow null comment
.build());
client.alterTable(rawName, alterOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,10 @@ public void testCreateTable()
throw new SkipException("TODO");
}

@Test
@Override
public void testAddColumn()
protected String tableDefinitionForAddColumn()
{
// TODO Support these test once kudu connector can create tables with default partitions
throw new SkipException("TODO");
return "(x VARCHAR WITH (primary_key=true)) WITH (partition_by_hash_columns = ARRAY['x'], partition_by_hash_buckets = 2)";
}

@Test
Expand Down

0 comments on commit 9a30b28

Please sign in to comment.