cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

LZO codec not working for graviton instances

yatharth
New Contributor III

Hi databricks:

I have a job where I am saving my data in json format lzo compressed which requires the library lzo-codec
on shifting to graviton instances

 

I noticed that the same job started throwing exception
Caused by: java.lang.RuntimeException: native-lzo library not available at com.hadoop.compression.lzo.LzoCodec.getCompressorType(LzoCodec.java:155) at org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:150) at com.hadoop.compression.lzo.LzopCodec.getCompressor(LzopCodec.java:171) at com.hadoop.compression.lzo.LzopCodec.createOutputStream(LzopCodec.java:72)

Current Config:
Worker- c6g.4xlarge
Driver- c6g.xlarge
Older config:
Worker- r4.8xlarge
Driver- r4.xlarge

Please suggest a solution
1 REPLY 1

yatharth
New Contributor III

For more context, Please use the following code to replicate the error:

# Create a Python list containing JSON objects
json_data = [
    {
        "id": 1,
        "name": "John",
        "age": 25
    },
    {
        "id": 2,
        "name": "Jane",
        "age": 30
    },
    {
        "id": 3,
        "name": "Mike",
        "age": 35
    }
]

# Create a DataFrame using the JSON data
df = spark.createDataFrame(json_data)
# Save the DataFrame in S3 with compression
df.write.format('json').save('s3://path', compression='com.hadoop.compression.lzo.LzopCodec')

Make sure to have lzo-codec installed in your cluster

Tried with both R class instances and Graviton C class instances, and it always failed with in case of Graviton instance
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.