@@ -44,12 +44,11 @@ impl TableRowEncoder {
44
44
45
45
let arrow_schema = Schema :: new ( fields) ;
46
46
47
- let result = RecordBatch :: try_new ( Arc :: new ( arrow_schema) , arrays) ;
48
-
49
- result
47
+ RecordBatch :: try_new ( Arc :: new ( arrow_schema) , arrays)
50
48
}
51
49
52
50
/// Convert Delta schema to Arrow schema
51
+ #[ allow( unused) ]
53
52
fn delta_schema_to_arrow (
54
53
delta_schema : & deltalake:: kernel:: StructType ,
55
54
) -> Result < Schema , ArrowError > {
@@ -60,24 +59,24 @@ impl TableRowEncoder {
60
59
. fields ( )
61
60
. map ( |field| {
62
61
// Convert Delta DataType to Arrow DataType
63
- let arrow_type = match field. data_type ( ) {
64
- & deltalake:: kernel:: DataType :: BOOLEAN => DataType :: Boolean ,
65
- & deltalake:: kernel:: DataType :: STRING => DataType :: Utf8 ,
66
- & deltalake:: kernel:: DataType :: INTEGER => DataType :: Int32 ,
67
- & deltalake:: kernel:: DataType :: LONG => DataType :: Int64 ,
68
- & deltalake:: kernel:: DataType :: SHORT => DataType :: Int16 ,
69
- & deltalake:: kernel:: DataType :: FLOAT => DataType :: Float32 ,
70
- & deltalake:: kernel:: DataType :: DOUBLE => DataType :: Float64 ,
71
- & deltalake:: kernel:: DataType :: DATE => DataType :: Date32 ,
72
- & deltalake:: kernel:: DataType :: TIMESTAMP => DataType :: Timestamp (
62
+ let arrow_type = match * field. data_type ( ) {
63
+ deltalake:: kernel:: DataType :: BOOLEAN => DataType :: Boolean ,
64
+ deltalake:: kernel:: DataType :: STRING => DataType :: Utf8 ,
65
+ deltalake:: kernel:: DataType :: INTEGER => DataType :: Int32 ,
66
+ deltalake:: kernel:: DataType :: LONG => DataType :: Int64 ,
67
+ deltalake:: kernel:: DataType :: SHORT => DataType :: Int16 ,
68
+ deltalake:: kernel:: DataType :: FLOAT => DataType :: Float32 ,
69
+ deltalake:: kernel:: DataType :: DOUBLE => DataType :: Float64 ,
70
+ deltalake:: kernel:: DataType :: DATE => DataType :: Date32 ,
71
+ deltalake:: kernel:: DataType :: TIMESTAMP => DataType :: Timestamp (
73
72
deltalake:: arrow:: datatypes:: TimeUnit :: Microsecond ,
74
73
Some ( "UTC" . into ( ) ) ,
75
74
) ,
76
- & deltalake:: kernel:: DataType :: TIMESTAMP_NTZ => DataType :: Timestamp (
75
+ deltalake:: kernel:: DataType :: TIMESTAMP_NTZ => DataType :: Timestamp (
77
76
deltalake:: arrow:: datatypes:: TimeUnit :: Microsecond ,
78
77
None ,
79
78
) ,
80
- & deltalake:: kernel:: DataType :: BINARY => DataType :: Binary ,
79
+ deltalake:: kernel:: DataType :: BINARY => DataType :: Binary ,
81
80
// Default to string for complex/unsupported types
82
81
_ => DataType :: Utf8 ,
83
82
} ;
@@ -184,6 +183,7 @@ impl TableRowEncoder {
184
183
}
185
184
186
185
/// Convert Cell values to specific Arrow array types
186
+ #[ allow( unused) ]
187
187
fn convert_bool_column ( cells : Vec < & Cell > ) -> Result < ArrayRef , ArrowError > {
188
188
// todo(abhi): Extract boolean values from cells, handle nulls
189
189
let values: Vec < Option < bool > > = cells
@@ -198,6 +198,7 @@ impl TableRowEncoder {
198
198
Ok ( Arc :: new ( BooleanArray :: from ( values) ) )
199
199
}
200
200
201
+ #[ allow( unused) ]
201
202
fn convert_string_column ( cells : Vec < & Cell > ) -> Result < ArrayRef , ArrowError > {
202
203
// todo(abhi): Extract string values from cells, handle nulls and conversions
203
204
let values: Vec < Option < String > > = cells
@@ -213,6 +214,7 @@ impl TableRowEncoder {
213
214
Ok ( Arc :: new ( StringArray :: from ( values) ) )
214
215
}
215
216
217
+ #[ allow( unused) ]
216
218
fn convert_int32_column ( cells : Vec < & Cell > ) -> Result < ArrayRef , ArrowError > {
217
219
// todo(abhi): Extract i32 values from cells, handle nulls and conversions
218
220
let values: Vec < Option < i32 > > = cells
@@ -228,6 +230,7 @@ impl TableRowEncoder {
228
230
Ok ( Arc :: new ( Int32Array :: from ( values) ) )
229
231
}
230
232
233
+ #[ allow( unused) ]
231
234
fn convert_array_column ( cells : Vec < & Cell > ) -> Result < ArrayRef , ArrowError > {
232
235
// todo(abhi): Convert ArrayCell variants to Arrow ListArray
233
236
// todo(abhi): Handle nested arrays properly with element type detection
0 commit comments