Issues Connecting to Infor Data Lake Using Spark JDBC in Azure Synapse Spark Notebook

Sriram M 40 Reputation points
2024-07-04T09:19:18.87+00:00

Hi Team,

I'm encountering difficulties while attempting to connect to Infor Data Lake using Spark JDBC within Azure Synapse. Despite configuring the necessary JDBC driver and ionapi file path, I consistently encounter the following error:

"Py4JJavaError: An error occurred while calling o3997.jdbc.

: java.lang.RuntimeException: JDBC Error 100

Unable to connect. The Infor Compass JDBC Driver.ionapi file is not found. The file must be located in the folder containing the Compass JDBC driver JAR file."

Setup Details:

I've initialized my Spark session in Azure Synapse with the required JDBC driver and specified the ionapi file path using spark.jars.

The ionapi file is stored in Azure Data Lake Storage (ADLS), and I have ensured the path is correctly specified in the JDBC connection properties.

Code Snippet:

%%configure -f

{

"conf": {  

    "spark.jars": "abfss://container@datalake_name.dfs.core.windows.net/infor-compass-jdbc-2023.10.jar",  

}  

}

storage_account_name = "**"

container_name = "**"

jdbc_jar_path = f"abfss://{container_name}@{storage_account_name}.dfs.core.windows.net/path_to_jdbc_driver/infor-compass-jdbc-2023.10.jar"

ionapi_file_path = f"abfss://{container_name}@{storage_account_name}.dfs.core.windows.net/path_to_ionapi_file/Infor Compass JDBC Driver.ionapi"

spark = SparkSession.builder \

.appName("InforDataLakeConnection") \

.config("spark.jars", jdbc_jar_path) \

.getOrCreate()

jdbc_url = "jdbc:infordatalake://your_infordatalake_endpoint"

jdbc_properties = {

"user": "**",

"password": "**",

"driver": "com.infor.idl.jdbc.Driver", 

"ionapi": ionapi_file_path 

}

table_name = "table_name"

df = spark.read.jdbc(url=jdbc_url, table=table_name, properties=jdbc_properties)

df.show()

Error Analysis:

I have verified that ionapi_file_path correctly points to the location of the ionapi file in ADLS.

The storage account key used in spark.conf.set matches the correct ADLS storage account.

Request for Assistance:

Could you please provide guidance on how to correctly configure the ionapi file path or any additional settings necessary to successfully connect to Infor Data Lake using Spark JDBC in Azure Synapse?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,305 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sky 0 Reputation points
    2025-04-24T01:44:25.29+00:00

    Surprisingly, I have your answer and found this thread while looking for a better way to connect to the Infor data lake. If you've found a better way, please let me know as I was hoping to find either a way to use the API directly or to use the JDBC on the data gateway server.

    For the JDBC connection where you can't reference the ionapi file, you have to modify the connection string to include the ion api credentials.

    Open the .ionapi file in an editor, like Notepad++, and copy out the contents. You need to encode this string for URLs, I recommend adding the MIME Tools plugin to Notepad++, hightlight the string and select Plugins - MIME Tools - URL Encode. Copy this new string.

    Back to your jdbc connection string, it begins with jdbc:infordatalake://TENANT_NAME, after the tenant name, add "?ionApiCredentials=" followed by the new string you copied, like this:

    ?ionApiCredentials=your_copied_url_encoded_ion_api_string

    The rest of the parameters in the connection string would then follow the end of that string. I'm just learning to use Spark in Fabric, but I suspect there's a way to store that ion api string as a secure key that can be referenced in that string, but for now the above works.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.