rdblue commented on a change in pull request #1569:
URL: https://github.com/apache/iceberg/pull/1569#discussion_r502830755
##########
File path: api/src/main/java/org/apache/iceberg/transforms/Truncate.java
##########
@@ -30,12 +30,16 @@
import org.apache.iceberg.expressions.Expressions;
import org.apache.iceberg.expressions.UnboundPredicate;
import org.apache.iceberg.relocated.com.google.common.base.Objects;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.types.Type;
import org.apache.iceberg.util.UnicodeUtil;
abstract class Truncate<T> implements Transform<T, T> {
@SuppressWarnings("unchecked")
static <T> Truncate<T> get(Type type, int width) {
+ Preconditions.checkArgument(width > 0,
+ "The width of truncate must be larger than zero, but is %s", width);
Review comment:
How about "Invalid truncate width: %s"? We try to keep error messages a
bit shorter and clearer, with the most useful information up front. In this
case, the problem is that the truncate width is invalid. We can also add more
clarification if you want, like "Invalid truncate width: %s (must be > 0)"
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]