Unsupported variable type using parquetread

12 次查看(过去 30 天)
I am trying to import data from a parquet file into Matlab. One of the columns has the structure:
Struct<altitude: Float64, latitude: Float64, longitude: Float64, type: String> which is an "unsupported parquet type" ands so the program is unable to read it into Matlab using:
parquetread
Is there any work around for this? I am aware of the data type mapping that is currently availble (https://uk.mathworks.com/help/matlab/import_export/datatype-mappings-matlab-parquet.html) and that this structure is ouside of the perview of the current system. I am keen to import this data into Matlab in some shape, so any direction is appreciated.
Thanks in advance.

回答(1 个)

Aditya
Aditya 2023-9-13
Hey Joseph,
I understand that you are getting an unsupported variable type using ‘parquetread.
If you encounter an unsupported Parquet type, such as a column with a complex structure like `Struct<altitude: Float64, latitude: Float64, longitude: Float64, type: String>`, when using the `parquetread` function in MATLAB, you may need to find an alternative approach to import the data into MATLAB. Here are a few possible workarounds:
1. Convert the Parquet file to a different format: If the Parquet file contains a column with an unsupported structure, you can try converting the Parquet file to a different format that MATLAB supports, such as CSV or JSON. There are various Parquet conversion tools available that can help you convert the Parquet file to a different format, which you can then import into MATLAB using the appropriate function (e.g., `readtable` for CSV or `jsondecode` for JSON).
2. Use a Parquet library: MATLAB has support for using Java libraries, so you can explore using a Parquet library in Java to read the Parquet file and extract the desired column. You can then pass the extracted data from Java to MATLAB using the `javaObject` function or by writing the data to a file that MATLAB can read using its supported functions.
By exploring these workarounds, you should be able to find a solution to import the Parquet data into MATLAB, even if the file contains unsupported column structures.
You may refer to the following documentation link for more information on the parquetread function:
Thanks,
Best Regards
Aditya Kaloji

标签

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by