Skip to content

Lenient LZ4 check #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2025
Merged

Lenient LZ4 check #298

merged 2 commits into from
May 19, 2025

Conversation

samikshya-db
Copy link
Contributor

Currently, LZ4 compression is not used if module is not found (i..e, when lz4 module is not installed). At times customer is running databricks nodejs driver in Azure functions or a non-supported arch compute, in that case it throws

{...}/node_modules/@databricks/sql/dist/utils/lz4.js:10
            throw err;
            ^

Error: {...}/node_modules/lz4/build/Release/xxhash.node: invalid ELF header
    at Module._extensions..node (node:internal/modules/cjs/loader:1460:18)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/home/dejhjs3e/projects/databricks-node/node_modules/lz4/lib/utils.js:4:11)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Making the error handling more lenient inorder to exclude lz4 compression whenever a dependency error is thrown.

This fixes the problems stated in : #289 #275 #266 #270

Copy link
Contributor

@shivam2680 shivam2680 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you test this?

@samikshya-db
Copy link
Contributor Author

Hello @shivam2680 ,
I tested with Azure functions. Thanks

@samikshya-db samikshya-db merged commit c085195 into main May 19, 2025
7 of 8 checks passed
@samikshya-db samikshya-db deleted the samikshya-chand_data/lenientLZ4Check branch May 19, 2025 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants