Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix decimal in get_testing_kernel_expression and visitor printing #456

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion ffi/examples/visit-expression/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/**
Expand Down
6 changes: 3 additions & 3 deletions ffi/examples/visit-expression/expression_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ void print_tree_helper(ExpressionItem ref, int depth) {
}
case Decimal: {
struct Decimal* dec = &lit->value.decimal;
printf("Decimal(%lld,%lld, %d, %d)\n",
printf("Decimal(%lld,%lld,%d,%d)\n",
(long long)dec->value[0],
(long long)dec->value[1],
dec->scale,
dec->precision);
dec->precision,
dec->scale);
break;
}
case Null:
Expand Down
2 changes: 1 addition & 1 deletion ffi/src/expressions/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub struct EngineExpressionVisitor {
pub visit_literal_struct: extern "C" fn(
data: *mut c_void,
sibling_list_id: usize,
child_field_list_value: usize,
child_field_list_id: usize,
child_value_list_id: usize,
),
/// Visit an array literal belonging to the list identified by `sibling_list_id`.
Expand Down
2 changes: 1 addition & 1 deletion ffi/src/test_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub unsafe extern "C" fn get_testing_kernel_expression() -> Handle<SharedExpress
Scalar::Date(32).into(),
Scalar::Binary(0x0000deadbeefcafeu64.to_be_bytes().to_vec()).into(),
// Both the most and least significant u64 of the Decimal value will be 1
Scalar::Decimal((1 << 64) + 1, 2, 3).into(),
Scalar::Decimal((1 << 64) + 1, 5, 3).into(),
Expr::null_literal(DataType::SHORT),
Scalar::Struct(top_level_struct).into(),
Scalar::Array(array_data).into(),
Expand Down
2 changes: 1 addition & 1 deletion ffi/tests/test-expression-visitor/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ And
TimestampNtz(100)
Date(32)
Binary(0000deadbeefcafe)
Decimal(1,1, 3, 2)
Decimal(1,1,5,3)
Null
Struct
Field: top
Expand Down
Loading