Skip to content

Commit f920cc3

Browse files
committed
update affected rows usage
1 parent 27fbc94 commit f920cc3

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

go/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func PrintAffectedRows(records []arrow.Record) {
1919
defer releaseRecords(records)
2020

2121
// By Datalayers' design, the affected rows is the value at the first row and the first column.
22-
affectedRows := records[0].Column(0).(*array.String).Value(0)
22+
affectedRows := records[0].Column(0).(*array.Int64).Value(0)
2323
fmt.Println("Affected rows: ", affectedRows)
2424
}
2525

python/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def print_affected_rows(df: pandas.DataFrame) -> int:
8-
print("Affected rows: {}".format(df["Count"][0]))
8+
print("Affected rows: {}".format(df["affected_rows"][0]))
99

1010

1111
def make_insert_binding() -> pa.RecordBatch:

rust/src/util.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::process::exit;
22
use std::sync::Arc;
33

44
use arrow_array::{
5-
Float32Array, Int32Array, Int8Array, RecordBatch, StringArray, TimestampMillisecondArray,
5+
Float32Array, Int32Array, Int64Array, Int8Array, RecordBatch, TimestampMillisecondArray,
66
};
77
use arrow_cast::pretty::pretty_format_batches;
88
use arrow_schema::{DataType, Field, Schema, TimeUnit};
@@ -30,12 +30,9 @@ pub fn print_affected_rows(batches: &[RecordBatch]) {
3030
.unwrap()
3131
.column(0)
3232
.as_any()
33-
.downcast_ref::<StringArray>()
33+
.downcast_ref::<Int64Array>()
3434
.unwrap()
35-
.value(0)
36-
.to_string()
37-
.parse::<u32>()
38-
.unwrap();
35+
.value(0);
3936
println!("Affected rows: {}", affected_rows);
4037
}
4138

0 commit comments

Comments
 (0)