diff --git a/Sources/SparkConnect/ProtoUtil.swift b/Sources/SparkConnect/ProtoUtil.swift index ace45a9..5a16269 100644 --- a/Sources/SparkConnect/ProtoUtil.swift +++ b/Sources/SparkConnect/ProtoUtil.swift @@ -64,6 +64,8 @@ func fromProto( // swiftlint:disable:this cyclomatic_complexity let arrowUnit: ArrowTime64Unit = timeType.unit == .microsecond ? .microseconds : .nanoseconds arrowType = ArrowTypeTime64(arrowUnit) } + case .struct_: + arrowType = ArrowType(ArrowType.ArrowStruct) default: arrowType = ArrowType(ArrowType.ArrowUnknown) } diff --git a/Tests/SparkConnectTests/Resources/queries/struct.sql b/Tests/SparkConnectTests/Resources/queries/struct.sql new file mode 100644 index 0000000..3ec2472 --- /dev/null +++ b/Tests/SparkConnectTests/Resources/queries/struct.sql @@ -0,0 +1 @@ +SELECT struct(1), struct(2, struct(3)) diff --git a/Tests/SparkConnectTests/Resources/queries/struct.sql.json b/Tests/SparkConnectTests/Resources/queries/struct.sql.json new file mode 100644 index 0000000..08ef088 --- /dev/null +++ b/Tests/SparkConnectTests/Resources/queries/struct.sql.json @@ -0,0 +1 @@ +[["{1}","{2,{3}}"]]