3

I am trying to get a Cloudera Impala ODBC running on a brand new M1 Mac. To do so, I installed MS ODBC 18 via the official MS documentation and also followed the Cloudera ODBC Connector Install Guide.

However, when trying to connect, I get following error:

[Error: [odbc] Error connecting to the database] {
  odbcErrors: [
    {
      state: '01000',
      code: 0,
      message: "[unixODBC][Driver Manager]Can't open lib '/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib' : file not found"
    }
  ]
}

My ODBC installation:

myuser@computer ~ % odbcinst -j
unixODBC 2.3.11
DRIVERS............: /opt/homebrew/etc/odbcinst.ini
SYSTEM DATA SOURCES: /opt/homebrew/etc/odbc.ini
FILE DATA SOURCES..: /opt/homebrew/etc/ODBCDataSources
USER DATA SOURCES..: /Users/myuser/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

odbcinst.ini

[ODBC Drivers]
Cloudera ODBC Driver for Impala      = Installed
Cloudera ODBC Driver for Apache Hive = Installed

[Cloudera ODBC Driver for Impala]
Description = Cloudera ODBC Driver for Impala
Driver      = /opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib

[Cloudera ODBC Driver for Apache Hive]
Driver = /opt/cloudera/hiveodbc/lib/universal/libclouderahiveodbc.dylib

odbc.ini

[foobarbinbaz]
Driver=/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib
HOST=***
PORT=433
AuthMech=3
UseSASL=0
UID=****
PWD=****
SSL=1
TransportMode=2
HTTPPath=clicervice
CAIssuedCertNamesMismatch=1
TrustedCerts=/opt/cloudera/impalaodbc/lib/universal/cacerts.pem
TSaslTransportBufSize=1000
RowsFetchedPerBlock=10000
SocketTimeout=0
StringColumnLength=32767
UseNativeQuery=0

What I checked:

  1. If the file /opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib actually exists (it does)
  2. Interchanging Driver in my odbc.ini Cloudera ODBC Driver for Impala and /opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib (in both cases it's gonna search for the path)
  3. The file /Users/myuser/.odbc.ini is actually a symlink to /Users/myuser/Library/ODBC/odbc.ini (but that shouldn't be a problem, right?)
  4. Checked the Known Issues article at Microsoft (but I couldn't find my specific problem)
  5. sudo chmod -R a+rw cloudera inside the /opt directory
Norman
  • 785
  • 7
  • 27
  • Hey! I am facing the exact same issue on an M1 Mac I am trying to set up, has this issue since been resolved for you? – ZeMoon Jul 27 '22 at 07:11

1 Answers1

1

As of v2.6.11 released 2021-03-26, the Cloudera ODBC Driver for Apache Hive does not include an ARM64 component in its universal binary. I imagine the same for the Impala driver, too.

$ file /opt/cloudera/hiveodbc/lib/universal/libclouderahiveodbc.dylib
/opt/cloudera/hiveodbc/lib/universal/libclouderahiveodbc.dylib: Mach-O universal binary with 2 architectures: [i386:Mach-O dynamically linked shared library i386
- Mach-O dynamically linked shared library i386] [x86_64]
/opt/cloudera/hiveodbc/lib/universal/libclouderahiveodbc.dylib (for architecture i386): Mach-O dynamically linked shared library i386
/opt/cloudera/hiveodbc/lib/universal/libclouderahiveodbc.dylib (for architecture x86_64):       Mach-O 64-bit dynamically linked shared library x86_64
$ lipo -archs /opt/cloudera/hiveodbc/lib/universal/libclouderahiveodbc.dylib
i386 x86_64

My system:

$ sw_vers 
ProductName:    macOS
ProductVersion: 12.5
BuildVersion:   21G72
$ uname -mprsv
Darwin 21.6.0 Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:22 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T6000 arm64 arm

This library won't work until Cloudera updates the driver with an ARM64 version.

See also Hive ODBC driver on m1 Mac.

Colin Dean
  • 1,429
  • 1
  • 15
  • 26