Skip to content

Commit 560b798

Browse files
committed
remove warn on execute update
1 parent d4a0cea commit 560b798

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

go/main.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,14 @@ func main() {
162162
INSERT INTO go.demo (ts, sid, value, flag) VALUES
163163
('2024-09-03T10:00:00+08:00', 1, 4.5, 0),
164164
('2024-09-03T10:05:00+08:00', 2, 11.6, 1);`
165-
_, err = client.ExecuteUpdate(sql)
165+
affectedRows, err := client.ExecuteUpdate(sql)
166166
if err != nil {
167167
fmt.Println("Failed to insert data: ", err)
168168
return
169169
}
170-
// It's expected that the affected rows is 2.
171-
// However, the Go implementation of Arrow Flight SQL client might have some flaws and the affected rows is always 0.
172-
//
173170
// The output should be:
174171
// Affected rows: 2
175-
// fmt.Println("Affected rows: ", affectedRows)
172+
fmt.Println("Affected rows: ", affectedRows)
176173

177174
// Checks that the data are inserted successfully.
178175
sql = "SELECT * FROM go.demo where ts >= '2024-09-03T10:00:00+08:00'"

python/main.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,10 @@ def main():
114114
('2024-09-03T10:00:00+08:00', 1, 4.5, 0),
115115
('2024-09-03T10:05:00+08:00', 2, 11.6, 1);
116116
"""
117-
#! It's expected that the affected rows is 2.
118-
#! However, the flightsql-dbapi library seems does not implement the `execute_update` correctly
119-
#! and the returned affected rows is always 0.
120117
affected_rows = client.execute_update(sql)
121118
# The output should be:
122119
# Affected rows: 2
123-
# print("Affected rows: {}".format(affected_rows))
120+
print("Affected rows: {}".format(affected_rows))
124121

125122
# Checks that the data are inserted successfully.
126123
sql = "SELECT * FROM python.demo where ts >= '2024-09-03T10:00:00+08:00'"

0 commit comments

Comments
 (0)