@@ -521,6 +521,7 @@ fn struct_array_to_map(arr: &StructArray) -> DeltaResult<HashMap<String, Option<
521
521
mod tests {
522
522
use std:: sync:: Arc ;
523
523
524
+ use arrow_array:: ArrayRef ;
524
525
use object_store:: local:: LocalFileSystem ;
525
526
526
527
use super :: * ;
@@ -534,13 +535,12 @@ mod tests {
534
535
let store = Arc :: new ( LocalFileSystem :: new ( ) ) ;
535
536
let handler = DefaultJsonHandler :: new ( store, Arc :: new ( TokioBackgroundExecutor :: new ( ) ) ) ;
536
537
537
- let json_strings: StringArray = vec ! [
538
+ let json_strings: ArrayRef = Arc :: new ( StringArray :: from ( vec ! [
538
539
r#"{"add":{"path":"part-00000-fae5310a-a37d-4e51-827b-c3d5516560ca-c000.snappy.parquet","partitionValues":{},"size":635,"modificationTime":1677811178336,"dataChange":true,"stats":"{\"numRecords\":10,\"minValues\":{\"value\":0},\"maxValues\":{\"value\":9},\"nullCount\":{\"value\":0},\"tightBounds\":true}","tags":{"INSERTION_TIME":"1677811178336000","MIN_INSERTION_TIME":"1677811178336000","MAX_INSERTION_TIME":"1677811178336000","OPTIMIZE_TARGET_SIZE":"268435456"}}}"# ,
539
540
r#"{"commitInfo":{"timestamp":1677811178585,"operation":"WRITE","operationParameters":{"mode":"ErrorIfExists","partitionBy":"[]"},"isolationLevel":"WriteSerializable","isBlindAppend":true,"operationMetrics":{"numFiles":"1","numOutputRows":"10","numOutputBytes":"635"},"engineInfo":"Databricks-Runtime/<unknown>","txnId":"a6a94671-55ef-450e-9546-b8465b9147de"}}"# ,
540
541
r#"{"protocol":{"minReaderVersion":3,"minWriterVersion":7,"readerFeatures":["deletionVectors"],"writerFeatures":["deletionVectors"]}}"# ,
541
542
r#"{"metaData":{"id":"testId","format":{"provider":"parquet","options":{}},"schemaString":"{\"type\":\"struct\",\"fields\":[{\"name\":\"value\",\"type\":\"integer\",\"nullable\":true,\"metadata\":{}}]}","partitionColumns":[],"configuration":{"delta.enableDeletionVectors":"true","delta.columnMapping.mode":"none"},"createdTime":1677811175819}}"# ,
542
- ]
543
- . into ( ) ;
543
+ ] ) ) ;
544
544
let output_schema = Arc :: new ( log_schema ( ) . clone ( ) ) ;
545
545
handler. parse_json ( json_strings, output_schema) . unwrap ( )
546
546
}
@@ -597,15 +597,14 @@ mod tests {
597
597
let store = Arc :: new ( LocalFileSystem :: new ( ) ) ;
598
598
let handler = DefaultJsonHandler :: new ( store, Arc :: new ( TokioBackgroundExecutor :: new ( ) ) ) ;
599
599
600
- let json_strings: StringArray = vec ! [
600
+ let json_strings: ArrayRef = Arc :: new ( StringArray :: from ( vec ! [
601
601
r#"{"commitInfo":{"timestamp":1670892998177,"operation":"WRITE","operationParameters":{"mode":"Append","partitionBy":"[\"c1\",\"c2\"]"},"isolationLevel":"Serializable","isBlindAppend":true,"operationMetrics":{"numFiles":"3","numOutputRows":"3","numOutputBytes":"1356"},"engineInfo":"Apache-Spark/3.3.1 Delta-Lake/2.2.0","txnId":"046a258f-45e3-4657-b0bf-abfb0f76681c"}}"# ,
602
602
r#"{"protocol":{"minReaderVersion":1,"minWriterVersion":2}}"# ,
603
603
r#"{"metaData":{"id":"aff5cb91-8cd9-4195-aef9-446908507302","format":{"provider":"parquet","options":{}},"schemaString":"{\"type\":\"struct\",\"fields\":[{\"name\":\"c1\",\"type\":\"integer\",\"nullable\":true,\"metadata\":{}},{\"name\":\"c2\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"c3\",\"type\":\"integer\",\"nullable\":true,\"metadata\":{}}]}","partitionColumns":["c1","c2"],"configuration":{},"createdTime":1670892997849}}"# ,
604
604
r#"{"add":{"path":"c1=4/c2=c/part-00003-f525f459-34f9-46f5-82d6-d42121d883fd.c000.snappy.parquet","partitionValues":{"c1":"4","c2":"c"},"size":452,"modificationTime":1670892998135,"dataChange":true,"stats":"{\"numRecords\":1,\"minValues\":{\"c3\":5},\"maxValues\":{\"c3\":5},\"nullCount\":{\"c3\":0}}"}}"# ,
605
605
r#"{"add":{"path":"c1=5/c2=b/part-00007-4e73fa3b-2c88-424a-8051-f8b54328ffdb.c000.snappy.parquet","partitionValues":{"c1":"5","c2":"b"},"size":452,"modificationTime":1670892998135,"dataChange":true,"stats":"{\"numRecords\":1,\"minValues\":{\"c3\":6},\"maxValues\":{\"c3\":6},\"nullCount\":{\"c3\":0}}"}}"# ,
606
606
r#"{"add":{"path":"c1=6/c2=a/part-00011-10619b10-b691-4fd0-acc4-2a9608499d7c.c000.snappy.parquet","partitionValues":{"c1":"6","c2":"a"},"size":452,"modificationTime":1670892998135,"dataChange":true,"stats":"{\"numRecords\":1,\"minValues\":{\"c3\":4},\"maxValues\":{\"c3\":4},\"nullCount\":{\"c3\":0}}"}}"# ,
607
- ]
608
- . into ( ) ;
607
+ ] ) ) ;
609
608
let output_schema = Arc :: new ( log_schema ( ) . clone ( ) ) ;
610
609
let batch = handler. parse_json ( json_strings, output_schema) . unwrap ( ) ;
611
610
0 commit comments