paul-rogers commented on a change in pull request #1383: DRILL-6613: Refactor
MaterializedField
URL: https://github.com/apache/drill/pull/1383#discussion_r203254351
##########
File path:
exec/vector/src/main/java/org/apache/drill/exec/record/MaterializedField.java
##########
@@ -115,56 +175,17 @@ public void removeChild(MaterializedField field) {
*/
public void replaceType(MajorType newType) {
- assert type.getMinorType() == newType.getMinorType();
- assert type.getMode() == newType.getMode();
+ Preconditions.checkArgument(type.getMinorType() == newType.getMinorType());
+ Preconditions.checkArgument(type.getMode() == newType.getMode());
Review comment:
Any reason to pay this cost for all queries? Isn't a test-time assert
sufficient?
Also, what the heck does it mean to replace a type if we assert that the new
type is the same as the old one? We are actually setting the precision and
scale fields. Maybe the child types.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services