Add FLOAT support to ScalarFunction return type#1073
Conversation
Extends vector_set_value_at() to support FLOAT (single-precision float) return values. This completes Phase 1 of the type support plan - all simple numeric types (BOOLEAN, INTEGER, BIGINT, FLOAT, DOUBLE) are now supported! Changes: - Add DUCKDB_TYPE_FLOAT case to vector_set_value_at() switch - Convert Ruby value to float using (float)NUM2DBL macro - Update type validation to allow :float - Add test_scalar_function_float_return_type test case Implementation follows TDD approach: 1. RED: Added failing test for FLOAT return type 2. GREEN: Added FLOAT case to C switch statement 3. GREEN: Updated Ruby type validation 4. Verified all 15 tests pass with 23 assertions Type conversion: - Ruby → DuckDB: (float)NUM2DBL (convert to double, then cast to float) - DuckDB → Ruby: DBL2NUM (already supported in vector_value_at) Test coverage: - Tests floating-point arithmetic: 2.5 + 0.5 = 3.0 - Uses assert_in_delta for floating-point comparison Type ID: DUCKDB_TYPE_FLOAT = 10 Phase 1 Complete! Supported types: - BOOLEAN (bool) - PR #1072 - INTEGER (int32_t) - Original - BIGINT (int64_t) - PR #1070 - FLOAT (float) - This PR - DOUBLE (double) - PR #1071 Related to plan: extend-vector-set-value-at-types.md Phase 1.4
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Completes Phase 1 - all simple numeric types now supported!