Skip to content

Commit eecc47e

Browse files
Revert commit: 314a726 (#18)
* Revert "return Int64 instead of UInt64 when returning count (#17)" This reverts commit 314a726. * revert changes as of a bad approach use
1 parent 314a726 commit eecc47e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

datafusion/core/tests/user_defined/insert_operation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl ExecutionPlan for TestInsertExec {
184184
fn make_count_schema() -> SchemaRef {
185185
Arc::new(Schema::new(vec![Field::new(
186186
"count",
187-
DataType::Int64, // should return signed int for snowflake
187+
DataType::UInt64,
188188
false,
189189
)]))
190190
}

datafusion/expr/src/logical_plan/dml.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ impl Display for InsertOp {
203203

204204
fn make_count_schema() -> DFSchemaRef {
205205
Arc::new(
206-
// should return signed int for snowflake
207-
Schema::new(vec![Field::new("count", DataType::Int64, false)])
206+
Schema::new(vec![Field::new("count", DataType::UInt64, false)])
208207
.try_into()
209208
.unwrap(),
210209
)

datafusion/physical-plan/src/insert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::ExecutionPlanProperties;
3232

3333
use arrow::datatypes::SchemaRef;
3434
use arrow::record_batch::RecordBatch;
35-
use arrow_array::{ArrayRef, Int64Array};
35+
use arrow_array::{ArrayRef, UInt64Array};
3636
use arrow_schema::{DataType, Field, Schema};
3737
use datafusion_common::{internal_err, Result};
3838
use datafusion_execution::TaskContext;
@@ -261,7 +261,7 @@ impl ExecutionPlan for DataSinkExec {
261261
/// +-------+,
262262
/// ```
263263
fn make_count_batch(count: u64) -> RecordBatch {
264-
let array = Arc::new(Int64Array::from(vec![count as i64])) as ArrayRef;
264+
let array = Arc::new(UInt64Array::from(vec![count])) as ArrayRef;
265265

266266
RecordBatch::try_from_iter_with_nullable(vec![("count", array, false)]).unwrap()
267267
}
@@ -270,7 +270,7 @@ fn make_count_schema() -> SchemaRef {
270270
// Define a schema.
271271
Arc::new(Schema::new(vec![Field::new(
272272
"count",
273-
DataType::Int64, // should return signed int for snowflake
273+
DataType::UInt64,
274274
false,
275275
)]))
276276
}

0 commit comments

Comments
 (0)