marc-pydantic commented on PR #18301: URL: https://github.com/apache/datafusion/pull/18301#issuecomment-3456837761
To be fair, I [personally](https://compilersaysno.com/posts/the-elements-of-rust-error-handling/) would also prefer internal errors, I was just deferring to you guys here. The problem occurring is an indicator of an input validation failure, while ideally this should have happened earlier and be encoded in the type system, this is probably the next best place to put this. If there's an assert, it'd be an API contract violated, so for completeness sake, I assume we'd have to put additional validation code that looks similar to the internal error one outside the function. As for the computational overhead, if I am not mistaken in reading the `arrow-buffer` source, this will be handled as counting bits on a packed bitvector, thus count ones will be used. Assuming some moderate compilation, I'd say the overhead for all cases of <=64 entries --- which should be the vast majority of cases? --- is a single CPU instruction, plus one branch not taken. I'd consider that negligible, but will happily be convinced otherwise! I've reverted the respective commits that turned it into macros, as requested :) -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
