3

I have parquet files hosted on S3 that I want to download and convert to JSON. I was able to use select_object_content to output certain files as JSON using SQL in the past. I need to find a faster way to do it because it is timing out for larger files.

I have tried the following:

df = pd.read_parquet(s3_location)
df = df.to_json(orient="records")

However, the JSON output from the above code includes the key paths (hotels.date.hotel_price INSTEAD OF hotels:{date:{hotel_price: 100}}.

Anyone know of a way to do this so that it comes out as the second type of JSON?

jtlz2
  • 7,700
  • 9
  • 64
  • 114
bnykpp
  • 55
  • 1
  • 5

1 Answers1

0

This might be too late of a response but for anyone else who runs into this same issue the easiest way is to download this parquet-viewer extension in VS Code and you will be able to preview your data as JSON.

Link to Extension for reference https://marketplace.visualstudio.com/items?itemName=dvirtz.parquet-viewer

Moira Leon
  • 29
  • 2