Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ColumnSignature

// Name must be nonnull, but type can be null (if the type is unknown)
if (name == null || name.isEmpty()) {
throw new IAE(name, "Column name must be non-empty");
throw new IAE("Column name must be provided and non-empty");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive by comment, we could've interpolated the name value here:

"Column name [%s] must be provided and non-empty", name

Would help differentiate between empty and null. That said, I wonder if this should be throwing an InvalidInput instead of IAE now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably have been doing InvalidInput. I forgot about those! Somehow!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gianm This leads to a 500 error being thrown if the user hits this error, instead of the 400 (which was the older behavior). Raised a PR yesterday which addresses this and cleans up exception handling of MSQ bits that reside in the broker. (#14534)

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ public void testErrorWithUnableToConstructColumnSignatureWithExtern()
"general"
)
.expectMessageContains(
"Cannot construct instance of `org.apache.druid.segment.column.ColumnSignature`, problem: `java.lang.NullPointerException`\n"
"Cannot construct instance of `org.apache.druid.segment.column.ColumnSignature`, problem: Column name must be provided and non-empty"
)
)
.verify();
Expand Down