deepakpanda93 commented on issue #14306:
URL: https://github.com/apache/hudi/issues/14306#issuecomment-3688929353
@ROOBALJINDAL I tried an alternative approach by forcing the `Pay` field to
be of type String, and it worked. This was tested using Hudi 0.15 with Spark
3.4.
If aggregations or mathematical calculations are required on the `Pay`
field, it can be explicitly type-cast at query time before performing those
operations.
Schema:
```
root
|-- _hoodie_commit_time: string (nullable = true)
|-- _hoodie_commit_seqno: string (nullable = true)
|-- _hoodie_record_key: string (nullable = true)
|-- _hoodie_partition_path: string (nullable = true)
|-- _hoodie_file_name: string (nullable = true)
|-- Services: struct (nullable = true)
| |-- BasisCalculation: struct (nullable = true)
| | |-- Pay: string (nullable = true)
|-- TotalPay: struct (nullable = true)
| |-- Pay: struct (nullable = true)
| | |-- Rate: struct (nullable = true)
| | | |-- _value: double (nullable = true)
| | | |-- defvalue: string (nullable = true)
| | |-- Basis: struct (nullable = true)
| | | |-- _value: string (nullable = true)
| | | |-- defvalue: string (nullable = true)
|-- record_key: string (nullable = false)
```
Output:
```
+-------------------+---------------------+------------------+----------------------+------------------------------------------------------------------------+-------------------------+--------------------------------------+----------+
|_hoodie_commit_time|_hoodie_commit_seqno
|_hoodie_record_key|_hoodie_partition_path|_hoodie_file_name
|Services |TotalPay
|record_key|
+-------------------+---------------------+------------------+----------------------+------------------------------------------------------------------------+-------------------------+--------------------------------------+----------+
|20251224062441786 |20251224062441786_0_0|1 |
|7b74de72-2a28-4464-b19d-e3894e895c59-0_0-52-76_20251224062441786.parquet|{{999999999999999.99999}}|{{{1.0E15,
null}, {twentyFive, null}}}|1 |
+-------------------+---------------------+------------------+----------------------+------------------------------------------------------------------------+-------------------------+--------------------------------------+----------+
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]