Skip to content

Commit 3140be2

Browse files
committed
added logging to dict
1 parent ec2f7b7 commit 3140be2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arrow-pg/src/encoder.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,21 +294,27 @@ pub fn encode_value<T: Encoder>(
294294
type_: &Type,
295295
format: FieldFormat,
296296
) -> PgWireResult<()> {
297+
println!("[DATAFUSION POSTGRES ENCODER] encode_value: idx={}, type={:?}", idx, arr.data_type());
297298
match arr.data_type() {
298299
DataType::Null => encoder.encode_field_with_type_and_format(&None::<i8>, type_, format)?,
299300
DataType::Boolean => {
301+
println!("BOOLEAN BRANCH");
300302
encoder.encode_field_with_type_and_format(&get_bool_value(arr, idx), type_, format)?
301303
}
302304
DataType::Int8 => {
305+
println!("BOOLEAN BRANCH");
303306
encoder.encode_field_with_type_and_format(&get_i8_value(arr, idx), type_, format)?
304307
}
305308
DataType::Int16 => {
309+
println!("BOOLEAN BRANCH");
306310
encoder.encode_field_with_type_and_format(&get_i16_value(arr, idx), type_, format)?
307311
}
308312
DataType::Int32 => {
313+
println!("BOOLEAN BRANCH");
309314
encoder.encode_field_with_type_and_format(&get_i32_value(arr, idx), type_, format)?
310315
}
311316
DataType::Int64 => {
317+
println!("BOOLEAN BRANCH");
312318
encoder.encode_field_with_type_and_format(&get_i64_value(arr, idx), type_, format)?
313319
}
314320
DataType::UInt8 => encoder.encode_field_with_type_and_format(
@@ -490,6 +496,7 @@ pub fn encode_value<T: Encoder>(
490496
}
491497
},
492498
DataType::List(_) | DataType::FixedSizeList(_, _) | DataType::LargeList(_) => {
499+
println!("LIST BRANCH");
493500
if arr.is_null(idx) {
494501
return encoder.encode_field_with_type_and_format(&None::<&[i8]>, type_, format);
495502
}
@@ -498,6 +505,7 @@ pub fn encode_value<T: Encoder>(
498505
encoder.encode_field_with_type_and_format(&value, type_, format)?
499506
}
500507
DataType::Struct(_) => {
508+
println!("STRUCT BRANCH");
501509
let fields = match type_.kind() {
502510
postgres_types::Kind::Composite(fields) => fields,
503511
_ => {
@@ -510,6 +518,7 @@ pub fn encode_value<T: Encoder>(
510518
encoder.encode_field_with_type_and_format(&value, type_, format)?
511519
}
512520
DataType::Dictionary(_, value_type) => {
521+
println!("DICT BRANCH");
513522
if arr.is_null(idx) {
514523
return encoder.encode_field_with_type_and_format(&None::<i8>, type_, format);
515524
}

0 commit comments

Comments
 (0)